activitysmith-cli 1.20.1 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -2
- package/package.json +1 -1
- package/src/approvals.js +1 -1
- package/src/cli.js +135 -49
package/README.md
CHANGED
|
@@ -279,6 +279,25 @@ activitysmith push \
|
|
|
279
279
|
--interruption-level "time-sensitive"
|
|
280
280
|
```
|
|
281
281
|
|
|
282
|
+
### Push Notification Sounds
|
|
283
|
+
|
|
284
|
+
Use `--sound` to choose the sound a Push Notification plays. Omit it to play the Push Notifications sound picked in the ActivitySmith app under Settings > Sounds.
|
|
285
|
+
|
|
286
|
+
| Value | Behavior |
|
|
287
|
+
| --- | --- |
|
|
288
|
+
| `default` | Plays the sound picked on the device. This is the same as omitting `--sound`. |
|
|
289
|
+
| `none` | Plays no sound. |
|
|
290
|
+
| A sound name | Plays one of the sounds bundled with the app: `arrive`, `bell`, `bells`, `bitflip`, `bloom`, `callout`, `chime`, `coin`, `corrupt`, `crest`, `cue`, `ding`, `drop`, `ember`, `emblem`, `flourish`, `glimmer`, `glint`, `glitch`, `lantern`, `nightfall`, `nudge`, `pixel`, `pop`, `signal`, `streak`, `tally`, `wand`, `whoosh`, or `zip`. |
|
|
291
|
+
|
|
292
|
+
Passive Push Notifications play no sound.
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
activitysmith push \
|
|
296
|
+
--title "💸 New sale" \
|
|
297
|
+
--message "Pro plan, \$29/month" \
|
|
298
|
+
--sound "coin"
|
|
299
|
+
```
|
|
300
|
+
|
|
282
301
|
### Replace a Push Notification
|
|
283
302
|
|
|
284
303
|
Every `push` prints a `Notification ID`. Pass it to `--replace` to update a Push Notification you already sent, for example when an incident you alerted on is resolved. The replacement takes the old notification's place on the Lock Screen and in history instead of stacking a second one. It arrives silently, without sound or waking the screen, and goes to the same recipients as the original, so `--channels` and `--interruption-level` don't apply.
|
|
@@ -476,6 +495,19 @@ For a countdown, send `durationSeconds`. Leave it out on later stream updates to
|
|
|
476
495
|
|
|
477
496
|
To start at 00:00 and count up, set `countsDown` to `false` and leave out `durationSeconds`.
|
|
478
497
|
|
|
498
|
+
To count down to a set time, send `timerEndAt` instead of `durationSeconds`. If the timer started earlier, also send `timerStartAt`. The progress bar then shows the time already gone.
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
activitysmith activity stream nightly-backup \
|
|
502
|
+
--content-state '{
|
|
503
|
+
"title": "Nightly Backup",
|
|
504
|
+
"subtitle": "uploading archive",
|
|
505
|
+
"type": "timer",
|
|
506
|
+
"timerStartAt": "2026-11-19T01:00:00Z",
|
|
507
|
+
"timerEndAt": "2026-11-19T02:00:00Z"
|
|
508
|
+
}'
|
|
509
|
+
```
|
|
510
|
+
|
|
479
511
|
### End Live Activity
|
|
480
512
|
|
|
481
513
|
Call `activity end-stream` with the same `stream_key` to dismiss the Live Activity. You can include final values before it is removed. Use `--auto-dismiss-seconds` or `--auto-dismiss-minutes` to delay dismissal. Use `0` for immediate dismissal. Seconds take precedence if both are set. JSON content state also accepts `autoDismissSeconds` or `auto_dismiss_seconds`.
|
|
@@ -540,15 +572,20 @@ Choose from these colors for the Live Activity accent, including progress bars a
|
|
|
540
572
|
|
|
541
573
|
Live Activities can include an action button.
|
|
542
574
|
|
|
543
|
-
- `open_url`: Open a web page
|
|
575
|
+
- `open_url`: Open a web page, run an iOS Shortcut, or open an app
|
|
544
576
|
- `webhook`: Trigger a backend GET/POST workflow
|
|
545
577
|
|
|
546
578
|
#### Open URL action
|
|
547
579
|
|
|
548
|
-
Open a web page
|
|
580
|
+
Open a web page, run an iOS Shortcut, or open an app when someone taps the button. Supported links:
|
|
549
581
|
|
|
550
582
|
- **HTTP/HTTPS:** Web pages, e.g. `https://example.com`
|
|
551
583
|
- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` <!-- full-width -->
|
|
584
|
+
- **App deep links:** Installed apps or specific content within them
|
|
585
|
+
- **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6`
|
|
586
|
+
- **Termius:** `termius://` to open the app
|
|
587
|
+
- **Claude:** `claude://code` to open the Code tab
|
|
588
|
+
- **ChatGPT:** `chatgpt://` to open the app <!-- Verify ChatGPT URL scheme on iOS before publishing -->
|
|
552
589
|
|
|
553
590
|
```bash
|
|
554
591
|
activitysmith activity stream prod-web-1 \
|
|
@@ -588,6 +625,26 @@ activitysmith activity stream prod-web-1 \
|
|
|
588
625
|
}'
|
|
589
626
|
```
|
|
590
627
|
|
|
628
|
+
#### End after the tap
|
|
629
|
+
|
|
630
|
+
Set `dismiss_after_action` on an `open_url` button to end the Live Activity when someone taps it. The button opens its link, then the Live Activity ends.
|
|
631
|
+
|
|
632
|
+
```bash
|
|
633
|
+
activitysmith activity stream agent-review \
|
|
634
|
+
--content-state '{
|
|
635
|
+
"title": "Review Ready",
|
|
636
|
+
"message": "Claude finished the checkout refactor.",
|
|
637
|
+
"type": "alert",
|
|
638
|
+
"color": "green"
|
|
639
|
+
}' \
|
|
640
|
+
--action '{
|
|
641
|
+
"title": "Open Claude",
|
|
642
|
+
"type": "open_url",
|
|
643
|
+
"url": "claude://code",
|
|
644
|
+
"dismiss_after_action": true
|
|
645
|
+
}'
|
|
646
|
+
```
|
|
647
|
+
|
|
591
648
|
#### Webhook action
|
|
592
649
|
|
|
593
650
|
```bash
|
|
@@ -651,6 +708,23 @@ activitysmith activity stream agent-approval \
|
|
|
651
708
|
}'
|
|
652
709
|
```
|
|
653
710
|
|
|
711
|
+
### Live Activity Sounds
|
|
712
|
+
|
|
713
|
+
Starting a Live Activity plays the Live Activities sound picked in the ActivitySmith app. Updates and ends are silent. Set `--sound` on a start, update, or end to choose its sound, with the same values as [Push Notification Sounds](#push-notification-sounds). A sound on an update or end plays only while the screen is on. Use it for moments that need attention, such as a failed step.
|
|
714
|
+
|
|
715
|
+
```bash
|
|
716
|
+
activitysmith activity stream deploy-api \
|
|
717
|
+
--content-state '{
|
|
718
|
+
"title": "Deploying API",
|
|
719
|
+
"subtitle": "Step 3 failed",
|
|
720
|
+
"type": "segmented_progress",
|
|
721
|
+
"numberOfSteps": 4,
|
|
722
|
+
"currentStep": 3,
|
|
723
|
+
"color": "red"
|
|
724
|
+
}' \
|
|
725
|
+
--sound "glitch"
|
|
726
|
+
```
|
|
727
|
+
|
|
654
728
|
## Lock Screen Widgets
|
|
655
729
|
|
|
656
730
|

|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "activitysmith-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Command-line interface for ActivitySmith. Send Push Notifications, start, update, and end Live Activities, and set App Icon Badge Counts from your terminal.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"activitysmith",
|
package/src/approvals.js
CHANGED
|
@@ -135,7 +135,7 @@ export const readGitChanges = async (range, { cwd = process.cwd() } = {}) => {
|
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
|
|
138
|
-
// The name the review screen shows: the last path component.
|
|
138
|
+
// The name the review screen shows: the last path component.
|
|
139
139
|
export const changedFileName = (path) => {
|
|
140
140
|
const trimmed = path.trim().replace(/[\\/]+$/, "");
|
|
141
141
|
const name = trimmed.slice(Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\")) + 1) || trimmed;
|
package/src/cli.js
CHANGED
|
@@ -73,6 +73,13 @@ const parseNumberOption = (label) => (value) => {
|
|
|
73
73
|
return parsed;
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
+
const parseDateOption = (label) => (value) => {
|
|
77
|
+
if (typeof value !== "string" || Number.isNaN(Date.parse(value))) {
|
|
78
|
+
throw new InvalidArgumentError(`${label} must be an ISO 8601 date-time`);
|
|
79
|
+
}
|
|
80
|
+
return new Date(value).toISOString();
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
const parseBooleanOption = (label) => (value) => {
|
|
77
84
|
if (typeof value !== "string") {
|
|
78
85
|
throw new InvalidArgumentError(`${label} must be true or false`);
|
|
@@ -123,6 +130,19 @@ const parseTagsOption = (value, previous = []) => {
|
|
|
123
130
|
return [...previous, ...tags];
|
|
124
131
|
};
|
|
125
132
|
|
|
133
|
+
// The API also accepts sound names outside the bundled list, so only the length is checked here.
|
|
134
|
+
const parseSoundOption = (value) => {
|
|
135
|
+
if (typeof value !== "string" || value.trim() === "" || value.length > 50) {
|
|
136
|
+
throw new InvalidArgumentError("sound must be 1-50 characters, such as chime, default, or none");
|
|
137
|
+
}
|
|
138
|
+
return value;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const SOUND_HELP = "Sound to play: a bundled sound name, default, or none";
|
|
142
|
+
const LIVE_ACTIVITY_CHANGE_SOUND_HELP = `${SOUND_HELP}. Silent by default; iOS plays the sound only while the screen is on`;
|
|
143
|
+
|
|
144
|
+
const withSound = (request, sound) => (sound === undefined ? request : { ...request, sound });
|
|
145
|
+
|
|
126
146
|
const parseMetricValueArgument = (value) => {
|
|
127
147
|
if (typeof value !== "string") {
|
|
128
148
|
throw new InvalidArgumentError("value must be a string or number");
|
|
@@ -166,31 +186,11 @@ const normalizeHttpsUrl = (value, label) => {
|
|
|
166
186
|
return parsed.toString();
|
|
167
187
|
};
|
|
168
188
|
|
|
169
|
-
const normalizeUrlWithSchemes = (value, label, schemes) => {
|
|
170
|
-
if (typeof value !== "string" || value.trim().length === 0) {
|
|
171
|
-
throw new Error(`${label} must be a non-empty string`);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
let parsed;
|
|
175
|
-
try {
|
|
176
|
-
parsed = new URL(value.trim());
|
|
177
|
-
} catch {
|
|
178
|
-
throw new Error(`${label} must be a valid URL`);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const allowedProtocols = schemes.map((scheme) => `${scheme}:`);
|
|
182
|
-
if (!allowedProtocols.includes(parsed.protocol)) {
|
|
183
|
-
throw new Error(`${label} must use ${schemes.join(" or ")}`);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return parsed.toString();
|
|
187
|
-
};
|
|
188
|
-
|
|
189
189
|
const normalizeActionUrl = (value, label, type, push = false) => {
|
|
190
190
|
if (type === "open_url") {
|
|
191
191
|
if (push) return normalizeOpenUrl(value, label);
|
|
192
192
|
const normalized = typeof value === "string" ? value.trim().replace(/^x-safari-https:\/\//i, "https://") : value;
|
|
193
|
-
return
|
|
193
|
+
return normalizeOpenUrl(normalized, label);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
return normalizeHttpsUrl(value, label);
|
|
@@ -252,6 +252,16 @@ const addContentStateOptions = (command, { includeAutoDismiss, includeAutoDismis
|
|
|
252
252
|
"Timer duration in seconds",
|
|
253
253
|
parseNumberOption("duration-seconds")
|
|
254
254
|
)
|
|
255
|
+
.option(
|
|
256
|
+
"--timer-start-at <date>",
|
|
257
|
+
"Timer start time as an ISO 8601 date-time",
|
|
258
|
+
parseDateOption("timer-start-at")
|
|
259
|
+
)
|
|
260
|
+
.option(
|
|
261
|
+
"--timer-end-at <date>",
|
|
262
|
+
"Timer end time as an ISO 8601 date-time (instead of --duration-seconds)",
|
|
263
|
+
parseDateOption("timer-end-at")
|
|
264
|
+
)
|
|
255
265
|
.option(
|
|
256
266
|
"--counts-down <boolean>",
|
|
257
267
|
"Set to false for an elapsed timer",
|
|
@@ -442,7 +452,27 @@ const validateContentState = (contentState, mode) => {
|
|
|
442
452
|
const hasMetrics = hasOwn(contentState, "metrics");
|
|
443
453
|
const hasDurationSeconds = hasOwn(contentState, "durationSeconds");
|
|
444
454
|
const hasCountsDown = hasOwn(contentState, "countsDown");
|
|
445
|
-
const
|
|
455
|
+
const hasTimerStartAt =
|
|
456
|
+
hasOwn(contentState, "timerStartAt") || hasOwn(contentState, "timer_start_at");
|
|
457
|
+
const hasTimerEndAt =
|
|
458
|
+
hasOwn(contentState, "timerEndAt") || hasOwn(contentState, "timer_end_at");
|
|
459
|
+
const hasTimerFields =
|
|
460
|
+
hasDurationSeconds || hasCountsDown || hasTimerStartAt || hasTimerEndAt;
|
|
461
|
+
|
|
462
|
+
for (const key of ["timerStartAt", "timer_start_at", "timerEndAt", "timer_end_at"]) {
|
|
463
|
+
if (!hasOwn(contentState, key)) continue;
|
|
464
|
+
const value = contentState[key];
|
|
465
|
+
if (typeof value !== "string" || Number.isNaN(Date.parse(value))) {
|
|
466
|
+
throw new Error(`contentState.${key} must be an ISO 8601 date-time`);
|
|
467
|
+
}
|
|
468
|
+
contentState[key] = new Date(value).toISOString();
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (hasDurationSeconds && hasTimerEndAt) {
|
|
472
|
+
throw new Error(
|
|
473
|
+
"Provide either contentState.durationSeconds or contentState.timerEndAt, not both"
|
|
474
|
+
);
|
|
475
|
+
}
|
|
446
476
|
|
|
447
477
|
for (const key of ["autoDismissSeconds", "auto_dismiss_seconds"]) {
|
|
448
478
|
if (hasOwn(contentState, key) &&
|
|
@@ -625,9 +655,14 @@ const validateContentState = (contentState, mode) => {
|
|
|
625
655
|
}
|
|
626
656
|
|
|
627
657
|
if (effectiveType === "timer") {
|
|
628
|
-
if (
|
|
658
|
+
if (
|
|
659
|
+
mode === "start" &&
|
|
660
|
+
!hasDurationSeconds &&
|
|
661
|
+
!hasTimerEndAt &&
|
|
662
|
+
contentState.countsDown !== false
|
|
663
|
+
) {
|
|
629
664
|
throw new Error(
|
|
630
|
-
`timer ${mode} requires contentState.durationSeconds, or contentState.countsDown=false`
|
|
665
|
+
`timer ${mode} requires contentState.durationSeconds or contentState.timerEndAt, or contentState.countsDown=false`
|
|
631
666
|
);
|
|
632
667
|
}
|
|
633
668
|
return;
|
|
@@ -752,6 +787,16 @@ const parseAction = (value, label, push = false) => {
|
|
|
752
787
|
throw new Error(`${label} with type=open_url cannot include method or body`);
|
|
753
788
|
}
|
|
754
789
|
|
|
790
|
+
if (!push && value.dismiss_after_action !== undefined) {
|
|
791
|
+
if (typeof value.dismiss_after_action !== "boolean") {
|
|
792
|
+
throw new Error(`${label}.dismiss_after_action must be a boolean`);
|
|
793
|
+
}
|
|
794
|
+
if (normalizedType !== "open_url") {
|
|
795
|
+
throw new Error(`${label}.dismiss_after_action is only supported for open_url`);
|
|
796
|
+
}
|
|
797
|
+
action.dismiss_after_action = value.dismiss_after_action;
|
|
798
|
+
}
|
|
799
|
+
|
|
755
800
|
return action;
|
|
756
801
|
};
|
|
757
802
|
|
|
@@ -908,6 +953,14 @@ const buildContentStateFromOptions = (options) => {
|
|
|
908
953
|
contentState.durationSeconds = options.durationSeconds;
|
|
909
954
|
}
|
|
910
955
|
|
|
956
|
+
if (options.timerStartAt !== undefined) {
|
|
957
|
+
contentState.timerStartAt = options.timerStartAt;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
if (options.timerEndAt !== undefined) {
|
|
961
|
+
contentState.timerEndAt = options.timerEndAt;
|
|
962
|
+
}
|
|
963
|
+
|
|
911
964
|
if (options.countsDown !== undefined) {
|
|
912
965
|
contentState.countsDown = options.countsDown;
|
|
913
966
|
}
|
|
@@ -957,6 +1010,8 @@ const toApiContentState = (contentState) => {
|
|
|
957
1010
|
autoDismissSeconds: "auto_dismiss_seconds",
|
|
958
1011
|
durationSeconds: "duration_seconds",
|
|
959
1012
|
countsDown: "counts_down",
|
|
1013
|
+
timerStartAt: "timer_start_at",
|
|
1014
|
+
timerEndAt: "timer_end_at",
|
|
960
1015
|
};
|
|
961
1016
|
|
|
962
1017
|
const mapped = {};
|
|
@@ -1325,6 +1380,11 @@ const pushCommand = program
|
|
|
1325
1380
|
"time-sensitive",
|
|
1326
1381
|
])
|
|
1327
1382
|
)
|
|
1383
|
+
.option(
|
|
1384
|
+
"--sound <name>",
|
|
1385
|
+
`${SOUND_HELP} (defaults to your Push Notifications sound)`,
|
|
1386
|
+
parseSoundOption
|
|
1387
|
+
)
|
|
1328
1388
|
.option("--redirection <url>", "HTTPS or shortcuts:// URL opened when notification is tapped")
|
|
1329
1389
|
.option("--actions <json>", "Actions JSON array (max 4)")
|
|
1330
1390
|
.option("--actions-file <path>", "Path to actions JSON array file")
|
|
@@ -1356,9 +1416,13 @@ const pushCommand = program
|
|
|
1356
1416
|
actions,
|
|
1357
1417
|
});
|
|
1358
1418
|
if (options.replace !== undefined) {
|
|
1359
|
-
if (
|
|
1419
|
+
if (
|
|
1420
|
+
options.channels !== undefined ||
|
|
1421
|
+
options.interruptionLevel !== undefined ||
|
|
1422
|
+
options.sound !== undefined
|
|
1423
|
+
) {
|
|
1360
1424
|
throw new Error(
|
|
1361
|
-
"--channels
|
|
1425
|
+
"--channels, --interruption-level, and --sound cannot be combined with --replace. Replacements go to the original recipients and arrive silently."
|
|
1362
1426
|
);
|
|
1363
1427
|
}
|
|
1364
1428
|
if (options.replace.trim() === "") {
|
|
@@ -1380,6 +1444,7 @@ const pushCommand = program
|
|
|
1380
1444
|
? normalizeHttpsUrl(options.icon, "icon")
|
|
1381
1445
|
: undefined,
|
|
1382
1446
|
interruption_level: options.interruptionLevel,
|
|
1447
|
+
sound: options.sound,
|
|
1383
1448
|
redirection:
|
|
1384
1449
|
options.redirection !== undefined
|
|
1385
1450
|
? normalizeOpenUrl(options.redirection, "redirection")
|
|
@@ -1567,6 +1632,11 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1567
1632
|
parseTagsOption
|
|
1568
1633
|
)
|
|
1569
1634
|
.option("--clear-tags", "Remove all Tags from this stream")
|
|
1635
|
+
.option(
|
|
1636
|
+
"--sound <name>",
|
|
1637
|
+
`${SOUND_HELP}. A new stream defaults to your Live Activities sound; updates are silent by default, and iOS plays an update sound only while the screen is on`,
|
|
1638
|
+
parseSoundOption
|
|
1639
|
+
)
|
|
1570
1640
|
.option("--metadata <json>", "Metadata JSON object shown in ActivitySmith details")
|
|
1571
1641
|
.option("--metadata-file <path>", "Path to a Metadata JSON object file")
|
|
1572
1642
|
.action(async (streamKey, options) => {
|
|
@@ -1584,17 +1654,20 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1584
1654
|
|
|
1585
1655
|
const response = await client.liveActivities.stream(
|
|
1586
1656
|
streamKey,
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1657
|
+
withSound(
|
|
1658
|
+
withTags(
|
|
1659
|
+
withTargetChannels(
|
|
1660
|
+
toApiLiveActivityStreamRequest(
|
|
1661
|
+
contentState,
|
|
1662
|
+
action,
|
|
1663
|
+
secondaryAction
|
|
1664
|
+
),
|
|
1665
|
+
options.channels
|
|
1593
1666
|
),
|
|
1594
|
-
options.
|
|
1667
|
+
options.clearTags ? [] : options.tags,
|
|
1668
|
+
await loadMetadata(options)
|
|
1595
1669
|
),
|
|
1596
|
-
options.
|
|
1597
|
-
await loadMetadata(options)
|
|
1670
|
+
options.sound
|
|
1598
1671
|
)
|
|
1599
1672
|
);
|
|
1600
1673
|
|
|
@@ -1626,6 +1699,11 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1626
1699
|
"Comma-separated tags for organizing history (repeatable)",
|
|
1627
1700
|
parseTagsOption
|
|
1628
1701
|
)
|
|
1702
|
+
.option(
|
|
1703
|
+
"--sound <name>",
|
|
1704
|
+
`${SOUND_HELP} (defaults to your Live Activities sound)`,
|
|
1705
|
+
parseSoundOption
|
|
1706
|
+
)
|
|
1629
1707
|
.option("--metadata <json>", "Metadata JSON object shown in ActivitySmith details")
|
|
1630
1708
|
.option("--metadata-file <path>", "Path to a Metadata JSON object file")
|
|
1631
1709
|
.action(async (options) => {
|
|
@@ -1639,17 +1717,20 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1639
1717
|
const secondaryAction = await loadLiveActivitySecondaryAction(options);
|
|
1640
1718
|
|
|
1641
1719
|
const response = await client.liveActivities.startLiveActivity({
|
|
1642
|
-
liveActivityStartRequest:
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1720
|
+
liveActivityStartRequest: withSound(
|
|
1721
|
+
withTags(
|
|
1722
|
+
withTargetChannels(
|
|
1723
|
+
toApiLiveActivityStartRequest(
|
|
1724
|
+
contentState,
|
|
1725
|
+
action,
|
|
1726
|
+
secondaryAction
|
|
1727
|
+
),
|
|
1728
|
+
options.channels
|
|
1648
1729
|
),
|
|
1649
|
-
options.
|
|
1730
|
+
options.tags,
|
|
1731
|
+
await loadMetadata(options)
|
|
1650
1732
|
),
|
|
1651
|
-
options.
|
|
1652
|
-
await loadMetadata(options)
|
|
1733
|
+
options.sound
|
|
1653
1734
|
),
|
|
1654
1735
|
});
|
|
1655
1736
|
|
|
@@ -1671,6 +1752,7 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1671
1752
|
.requiredOption("--activity-id <id>", "Live Activity ID")
|
|
1672
1753
|
.option("--tags <tags>", "Replace Tags for this Live Activity (repeatable)", parseTagsOption)
|
|
1673
1754
|
.option("--clear-tags", "Remove all Tags from this Live Activity")
|
|
1755
|
+
.option("--sound <name>", LIVE_ACTIVITY_CHANGE_SOUND_HELP, parseSoundOption)
|
|
1674
1756
|
.option("--metadata <json>", "Metadata JSON object shown in ActivitySmith details")
|
|
1675
1757
|
.option("--metadata-file <path>", "Path to a Metadata JSON object file")
|
|
1676
1758
|
.action(async (options) => {
|
|
@@ -1687,12 +1769,12 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1687
1769
|
const secondaryAction = await loadLiveActivitySecondaryAction(options);
|
|
1688
1770
|
|
|
1689
1771
|
const response = await client.liveActivities.updateLiveActivity({
|
|
1690
|
-
liveActivityUpdateRequest: withTags(toApiLiveActivityUpdateRequest(
|
|
1772
|
+
liveActivityUpdateRequest: withSound(withTags(toApiLiveActivityUpdateRequest(
|
|
1691
1773
|
options.activityId,
|
|
1692
1774
|
contentState,
|
|
1693
1775
|
action,
|
|
1694
1776
|
secondaryAction
|
|
1695
|
-
), options.clearTags ? [] : options.tags, await loadMetadata(options)),
|
|
1777
|
+
), options.clearTags ? [] : options.tags, await loadMetadata(options)), options.sound),
|
|
1696
1778
|
});
|
|
1697
1779
|
|
|
1698
1780
|
outputResult(response, globalOptions, [
|
|
@@ -1712,6 +1794,7 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1712
1794
|
.requiredOption("--activity-id <id>", "Live Activity ID")
|
|
1713
1795
|
.option("--tags <tags>", "Replace Tags for this Live Activity (repeatable)", parseTagsOption)
|
|
1714
1796
|
.option("--clear-tags", "Remove all Tags from this Live Activity")
|
|
1797
|
+
.option("--sound <name>", LIVE_ACTIVITY_CHANGE_SOUND_HELP, parseSoundOption)
|
|
1715
1798
|
.option("--metadata <json>", "Metadata JSON object shown in ActivitySmith details")
|
|
1716
1799
|
.option("--metadata-file <path>", "Path to a Metadata JSON object file")
|
|
1717
1800
|
.action(async (options) => {
|
|
@@ -1728,12 +1811,12 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1728
1811
|
const secondaryAction = await loadLiveActivitySecondaryAction(options);
|
|
1729
1812
|
|
|
1730
1813
|
const response = await client.liveActivities.endLiveActivity({
|
|
1731
|
-
liveActivityEndRequest: withTags(toApiLiveActivityEndRequest(
|
|
1814
|
+
liveActivityEndRequest: withSound(withTags(toApiLiveActivityEndRequest(
|
|
1732
1815
|
options.activityId,
|
|
1733
1816
|
contentState,
|
|
1734
1817
|
action,
|
|
1735
1818
|
secondaryAction
|
|
1736
|
-
), options.clearTags ? [] : options.tags, await loadMetadata(options)),
|
|
1819
|
+
), options.clearTags ? [] : options.tags, await loadMetadata(options)), options.sound),
|
|
1737
1820
|
});
|
|
1738
1821
|
|
|
1739
1822
|
outputResult(response, globalOptions, [
|
|
@@ -1754,6 +1837,7 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1754
1837
|
.argument("<stream-key>", "Stable stream key")
|
|
1755
1838
|
.option("--tags <tags>", "Comma-separated Tags", parseTagsOption)
|
|
1756
1839
|
.option("--clear-tags", "Clear existing Tags")
|
|
1840
|
+
.option("--sound <name>", LIVE_ACTIVITY_CHANGE_SOUND_HELP, parseSoundOption)
|
|
1757
1841
|
.option("--metadata <json>", "Metadata as a JSON object")
|
|
1758
1842
|
.option("--metadata-file <path>", "Metadata JSON file path")
|
|
1759
1843
|
.action(async (streamKey, options) => {
|
|
@@ -1772,7 +1856,8 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1772
1856
|
const request =
|
|
1773
1857
|
contentState !== undefined ||
|
|
1774
1858
|
action !== undefined ||
|
|
1775
|
-
secondaryAction !== undefined || tags !== undefined || metadata !== undefined
|
|
1859
|
+
secondaryAction !== undefined || tags !== undefined || metadata !== undefined ||
|
|
1860
|
+
options.sound !== undefined
|
|
1776
1861
|
? toApiLiveActivityStreamDeleteRequest(
|
|
1777
1862
|
contentState,
|
|
1778
1863
|
action,
|
|
@@ -1782,6 +1867,7 @@ addLiveActivityActionOptions(addContentStateOptions(
|
|
|
1782
1867
|
|
|
1783
1868
|
if (tags !== undefined) request.tags = tags;
|
|
1784
1869
|
if (metadata !== undefined) request.metadata = metadata;
|
|
1870
|
+
if (options.sound !== undefined) request.sound = options.sound;
|
|
1785
1871
|
const response = await client.liveActivities.endStream(streamKey, request);
|
|
1786
1872
|
|
|
1787
1873
|
const activityId = response?.activityId ?? response?.activity_id;
|