activitysmith 1.15.0 → 1.16.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 +112 -7
- package/dist/generated/apis/LiveActivitiesApi.d.ts +2 -2
- package/dist/generated/apis/LiveActivitiesApi.js +2 -2
- package/dist/generated/apis/PushNotificationsApi.d.ts +2 -2
- package/dist/generated/apis/PushNotificationsApi.js +2 -2
- package/dist/generated/models/index.d.ts +78 -12
- package/dist/src/ActivitySmith.d.ts +3 -1
- package/dist/src/ActivitySmith.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ await activitysmith.notifications.send({
|
|
|
142
142
|
});
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
###
|
|
145
|
+
### Interruption Levels
|
|
146
146
|
|
|
147
147
|

|
|
148
148
|
|
|
@@ -190,6 +190,26 @@ await activitysmith.notifications.send({
|
|
|
190
190
|
});
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
### Push Notification Sounds
|
|
194
|
+
|
|
195
|
+
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.
|
|
196
|
+
|
|
197
|
+
| Value | Behavior |
|
|
198
|
+
| --- | --- |
|
|
199
|
+
| `default` | Plays the sound picked on the device. This is the same as omitting `sound`. |
|
|
200
|
+
| `none` | Plays no sound. |
|
|
201
|
+
| 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`. |
|
|
202
|
+
|
|
203
|
+
Passive Push Notifications play no sound.
|
|
204
|
+
|
|
205
|
+
```js
|
|
206
|
+
await activitysmith.notifications.send({
|
|
207
|
+
title: "💸 New sale",
|
|
208
|
+
message: "Pro plan, $29/month",
|
|
209
|
+
sound: "coin",
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
193
213
|
### Replace a Push Notification
|
|
194
214
|
|
|
195
215
|
Every send returns 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.
|
|
@@ -208,6 +228,23 @@ await activitysmith.notifications.replace(sent.notification_id, {
|
|
|
208
228
|
});
|
|
209
229
|
```
|
|
210
230
|
|
|
231
|
+
### Dismiss a Push Notification
|
|
232
|
+
|
|
233
|
+
Pass the `notification_id` to `dismiss` when a Push Notification no longer needs attention, for example after you answered an agent's question somewhere else.
|
|
234
|
+
|
|
235
|
+
Dismissing clears it from the Lock Screen and Notification Center on every device it was sent to. History keeps it.
|
|
236
|
+
|
|
237
|
+
Devices clear the notification in the background, so it can take a moment.
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
const sent = await activitysmith.notifications.send({
|
|
241
|
+
title: "🙋 Agent needs your input",
|
|
242
|
+
message: "Approve the database migration?",
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
await activitysmith.notifications.dismiss(sent.notification_id);
|
|
246
|
+
```
|
|
247
|
+
|
|
211
248
|
## Live Activities
|
|
212
249
|
|
|
213
250
|
Choose the Live Activity type that matches what you want to show:
|
|
@@ -373,6 +410,20 @@ For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `c
|
|
|
373
410
|
|
|
374
411
|
To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`.
|
|
375
412
|
|
|
413
|
+
To count down to a set time, send `timer_end_at` instead of `duration_seconds`. If the timer started earlier, also send `timer_start_at`. The progress bar then shows the time already gone.
|
|
414
|
+
|
|
415
|
+
```ts
|
|
416
|
+
await activitysmith.liveActivities.stream("nightly-backup", {
|
|
417
|
+
content_state: {
|
|
418
|
+
title: "Nightly Backup",
|
|
419
|
+
subtitle: "uploading archive",
|
|
420
|
+
type: "timer",
|
|
421
|
+
timer_start_at: "2026-11-19T01:00:00Z",
|
|
422
|
+
timer_end_at: "2026-11-19T02:00:00Z",
|
|
423
|
+
},
|
|
424
|
+
});
|
|
425
|
+
```
|
|
426
|
+
|
|
376
427
|
### End Live Activity
|
|
377
428
|
|
|
378
429
|
Call `endStream(...)` with the same `streamKey` to dismiss the Live Activity. You can include final values before it is removed. Set `auto_dismiss_seconds` to dismiss it after a delay in seconds, or `auto_dismiss_minutes` for minutes. Use `0` for immediate dismissal. Seconds take precedence if both are set.
|
|
@@ -441,13 +492,13 @@ await activitysmith.liveActivities.stream("nightly-database-backup", {
|
|
|
441
492
|
});
|
|
442
493
|
```
|
|
443
494
|
|
|
444
|
-
###
|
|
495
|
+
### Colors
|
|
445
496
|
|
|
446
497
|
Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge:
|
|
447
498
|
|
|
448
499
|
`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`
|
|
449
500
|
|
|
450
|
-
###
|
|
501
|
+
### Actions
|
|
451
502
|
|
|
452
503
|

|
|
453
504
|
|
|
@@ -574,15 +625,31 @@ await activitysmith.liveActivities.stream("agent-approval", {
|
|
|
574
625
|
});
|
|
575
626
|
```
|
|
576
627
|
|
|
628
|
+
### Live Activity Sounds
|
|
629
|
+
|
|
630
|
+
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 also expands the Live Activity on the Lock Screen, so use it for moments that need attention, such as a failed step.
|
|
631
|
+
|
|
632
|
+
```ts
|
|
633
|
+
await activitysmith.liveActivities.stream("deploy-api", {
|
|
634
|
+
content_state: {
|
|
635
|
+
title: "Deploying API",
|
|
636
|
+
subtitle: "Step 3 failed",
|
|
637
|
+
type: "segmented_progress",
|
|
638
|
+
number_of_steps: 4,
|
|
639
|
+
current_step: 3,
|
|
640
|
+
color: "red",
|
|
641
|
+
},
|
|
642
|
+
sound: "glitch",
|
|
643
|
+
});
|
|
644
|
+
```
|
|
645
|
+
|
|
577
646
|
## Lock Screen Widgets
|
|
578
647
|
|
|
579
648
|

|
|
580
649
|
|
|
581
|
-
ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track.
|
|
650
|
+
ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Send a value to a metric key, add a widget to your Lock Screen, and it fetches the latest value automatically.
|
|
582
651
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
Use the metric key to update its value.
|
|
652
|
+
Use the metric key to update its value. The first value creates the metric.
|
|
586
653
|
|
|
587
654
|
```ts
|
|
588
655
|
await activitysmith.metrics.update("deploy.success_rate", 99.9);
|
|
@@ -594,6 +661,24 @@ String metric values work too.
|
|
|
594
661
|
await activitysmith.metrics.update("prod.status", "healthy");
|
|
595
662
|
```
|
|
596
663
|
|
|
664
|
+
### Create a metric
|
|
665
|
+
|
|
666
|
+
Use `create` to set the label and how widgets show the value, such as currency, percent, or a unit. Omitted fields keep their current values, so you can call it every time your app starts.
|
|
667
|
+
|
|
668
|
+
```ts
|
|
669
|
+
await activitysmith.metrics.create("mrr", {
|
|
670
|
+
label: "MRR",
|
|
671
|
+
format: "currency",
|
|
672
|
+
currency_code: "USD",
|
|
673
|
+
});
|
|
674
|
+
|
|
675
|
+
await activitysmith.metrics.update("mrr", 12450);
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
You can also create and edit metrics in the [web app](https://activitysmith.com/app/widgets).
|
|
679
|
+
|
|
680
|
+

|
|
681
|
+
|
|
597
682
|
## App Icon Badge
|
|
598
683
|
|
|
599
684
|

|
|
@@ -695,6 +780,26 @@ await activitysmith.badgeCount(3, {
|
|
|
695
780
|
});
|
|
696
781
|
```
|
|
697
782
|
|
|
783
|
+
## Paired Devices
|
|
784
|
+
|
|
785
|
+
List the iPhones and iPads paired to your account, for example to check that a device is paired before you send. Active devices come first:
|
|
786
|
+
|
|
787
|
+
```js
|
|
788
|
+
const { devices } = await activitysmith.devices.list();
|
|
789
|
+
|
|
790
|
+
for (const device of devices) {
|
|
791
|
+
console.log(device.device_name, device.system_name, device.is_active);
|
|
792
|
+
}
|
|
793
|
+
```
|
|
794
|
+
|
|
795
|
+
An empty list means no device is paired. Install ActivitySmith on your iPhone, sign in with the same account, and allow notifications. Channel-scoped API keys cannot list devices.
|
|
796
|
+
|
|
797
|
+
Pass `includeInactive` to also list devices that can no longer receive deliveries:
|
|
798
|
+
|
|
799
|
+
```js
|
|
800
|
+
await activitysmith.devices.list({ includeInactive: true });
|
|
801
|
+
```
|
|
802
|
+
|
|
698
803
|
## Error Handling
|
|
699
804
|
|
|
700
805
|
SDK calls return promises, so you can wrap API calls with `try/catch`:
|
|
@@ -53,12 +53,12 @@ export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
53
53
|
*/
|
|
54
54
|
endLiveActivityStream(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamDeleteResponse>;
|
|
55
55
|
/**
|
|
56
|
-
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer
|
|
56
|
+
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
|
|
57
57
|
* Start a new Live Activity or update an existing one
|
|
58
58
|
*/
|
|
59
59
|
reconcileLiveActivityStreamRaw(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStreamPutResponse>>;
|
|
60
60
|
/**
|
|
61
|
-
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer
|
|
61
|
+
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
|
|
62
62
|
* Start a new Live Activity or update an existing one
|
|
63
63
|
*/
|
|
64
64
|
reconcileLiveActivityStream(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamPutResponse>;
|
|
@@ -90,7 +90,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
90
90
|
return await response.value();
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer
|
|
93
|
+
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
|
|
94
94
|
* Start a new Live Activity or update an existing one
|
|
95
95
|
*/
|
|
96
96
|
async reconcileLiveActivityStreamRaw(requestParameters, initOverrides) {
|
|
@@ -120,7 +120,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
120
120
|
return new runtime.JSONApiResponse(response);
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer
|
|
123
|
+
* Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer, and timer_start_at when the timer started earlier, for example to show time already gone in the progress bar. Omit them on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them.
|
|
124
124
|
* Start a new Live Activity or update an existing one
|
|
125
125
|
*/
|
|
126
126
|
async reconcileLiveActivityStream(requestParameters, initOverrides) {
|
|
@@ -26,12 +26,12 @@ export interface SendPushNotificationRequest {
|
|
|
26
26
|
*/
|
|
27
27
|
export declare class PushNotificationsApi extends runtime.BaseAPI {
|
|
28
28
|
/**
|
|
29
|
-
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet.
|
|
29
|
+
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
|
|
30
30
|
* Dismiss a push notification
|
|
31
31
|
*/
|
|
32
32
|
dismissPushNotificationRaw(requestParameters: DismissPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PushNotificationDismissResponse>>;
|
|
33
33
|
/**
|
|
34
|
-
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet.
|
|
34
|
+
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
|
|
35
35
|
* Dismiss a push notification
|
|
36
36
|
*/
|
|
37
37
|
dismissPushNotification(requestParameters: DismissPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PushNotificationDismissResponse>;
|
|
@@ -20,7 +20,7 @@ const runtime = require("../runtime");
|
|
|
20
20
|
*/
|
|
21
21
|
class PushNotificationsApi extends runtime.BaseAPI {
|
|
22
22
|
/**
|
|
23
|
-
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet.
|
|
23
|
+
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
|
|
24
24
|
* Dismiss a push notification
|
|
25
25
|
*/
|
|
26
26
|
async dismissPushNotificationRaw(requestParameters, initOverrides) {
|
|
@@ -45,7 +45,7 @@ class PushNotificationsApi extends runtime.BaseAPI {
|
|
|
45
45
|
return new runtime.JSONApiResponse(response);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet.
|
|
48
|
+
* Clears a Push Notification you already sent from the Lock Screen and Notification Center on every device it was sent to, using the `notification_id` from the send response. Notification history keeps it. Devices clear the notification in the background, which can take a moment or wait until the ActivitySmith app next opens. A successful response means the dismissal was recorded, not that every device has cleared it yet. Calling this again for the same notification returns the same response and sends nothing. A dismissed notification cannot be replaced.
|
|
49
49
|
* Dismiss a push notification
|
|
50
50
|
*/
|
|
51
51
|
async dismissPushNotification(requestParameters, initOverrides) {
|
|
@@ -645,13 +645,13 @@ export declare const ContentStateEndStepColorsEnum: {
|
|
|
645
645
|
};
|
|
646
646
|
export type ContentStateEndStepColorsEnum = typeof ContentStateEndStepColorsEnum[keyof typeof ContentStateEndStepColorsEnum];
|
|
647
647
|
/**
|
|
648
|
-
* Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without
|
|
648
|
+
* Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds or timer_end_at for countdowns, or set counts_down false without them for an open-ended elapsed timer. Add timer_start_at for a timer that started earlier. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
649
649
|
* @export
|
|
650
650
|
* @interface ContentStateStart
|
|
651
651
|
*/
|
|
652
652
|
export interface ContentStateStart {
|
|
653
653
|
/**
|
|
654
|
-
*
|
|
654
|
+
* Title shown on the Live Activity. Send an empty string to show no title.
|
|
655
655
|
* @type {string}
|
|
656
656
|
* @memberof ContentStateStart
|
|
657
657
|
*/
|
|
@@ -693,11 +693,23 @@ export interface ContentStateStart {
|
|
|
693
693
|
*/
|
|
694
694
|
upper_limit?: number;
|
|
695
695
|
/**
|
|
696
|
-
* Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.
|
|
696
|
+
* Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted, unless you send timer_end_at. Counts from timer_start_at when you send it.
|
|
697
697
|
* @type {number}
|
|
698
698
|
* @memberof ContentStateStart
|
|
699
699
|
*/
|
|
700
700
|
duration_seconds?: number;
|
|
701
|
+
/**
|
|
702
|
+
* Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
|
|
703
|
+
* @type {string}
|
|
704
|
+
* @memberof ContentStateStart
|
|
705
|
+
*/
|
|
706
|
+
timer_start_at?: string;
|
|
707
|
+
/**
|
|
708
|
+
* Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both.
|
|
709
|
+
* @type {string}
|
|
710
|
+
* @memberof ContentStateStart
|
|
711
|
+
*/
|
|
712
|
+
timer_end_at?: string;
|
|
701
713
|
/**
|
|
702
714
|
* Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
|
|
703
715
|
* @type {boolean}
|
|
@@ -827,7 +839,7 @@ export type ContentStateStartStepColorsEnum = typeof ContentStateStartStepColors
|
|
|
827
839
|
*/
|
|
828
840
|
export interface ContentStateUpdate {
|
|
829
841
|
/**
|
|
830
|
-
*
|
|
842
|
+
* Title shown on the Live Activity. Send an empty string to show no title.
|
|
831
843
|
* @type {string}
|
|
832
844
|
* @memberof ContentStateUpdate
|
|
833
845
|
*/
|
|
@@ -869,11 +881,23 @@ export interface ContentStateUpdate {
|
|
|
869
881
|
*/
|
|
870
882
|
upper_limit?: number;
|
|
871
883
|
/**
|
|
872
|
-
* Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time
|
|
884
|
+
* Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time, or from timer_start_at when you send it. Omit it to preserve the existing timer window.
|
|
873
885
|
* @type {number}
|
|
874
886
|
* @memberof ContentStateUpdate
|
|
875
887
|
*/
|
|
876
888
|
duration_seconds?: number;
|
|
889
|
+
/**
|
|
890
|
+
* Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
|
|
891
|
+
* @type {string}
|
|
892
|
+
* @memberof ContentStateUpdate
|
|
893
|
+
*/
|
|
894
|
+
timer_start_at?: string;
|
|
895
|
+
/**
|
|
896
|
+
* Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. Send timer_end_at alone to move the end and keep the current start.
|
|
897
|
+
* @type {string}
|
|
898
|
+
* @memberof ContentStateUpdate
|
|
899
|
+
*/
|
|
900
|
+
timer_end_at?: string;
|
|
877
901
|
/**
|
|
878
902
|
* Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
|
|
879
903
|
* @type {boolean}
|
|
@@ -1161,6 +1185,12 @@ export interface LiveActivityEndRequest {
|
|
|
1161
1185
|
* @memberof LiveActivityEndRequest
|
|
1162
1186
|
*/
|
|
1163
1187
|
secondary_action?: LiveActivityAction;
|
|
1188
|
+
/**
|
|
1189
|
+
* Optional sound for the end. Ends are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith 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`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
1190
|
+
* @type {string}
|
|
1191
|
+
* @memberof LiveActivityEndRequest
|
|
1192
|
+
*/
|
|
1193
|
+
sound?: string;
|
|
1164
1194
|
}
|
|
1165
1195
|
/**
|
|
1166
1196
|
* Returned after a Live Activity end event is sent or queued.
|
|
@@ -1328,6 +1358,12 @@ export interface LiveActivityStartRequest {
|
|
|
1328
1358
|
* @memberof LiveActivityStartRequest
|
|
1329
1359
|
*/
|
|
1330
1360
|
tags?: Array<string>;
|
|
1361
|
+
/**
|
|
1362
|
+
* Optional sound for the start. Omit it to play the Live Activities sound picked on the device. Sounds bundled with the ActivitySmith 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`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
1363
|
+
* @type {string}
|
|
1364
|
+
* @memberof LiveActivityStartRequest
|
|
1365
|
+
*/
|
|
1366
|
+
sound?: string;
|
|
1331
1367
|
}
|
|
1332
1368
|
/**
|
|
1333
1369
|
* Returned after a Live Activity starts. Save activity_id and use it for all later updates and for the final end call.
|
|
@@ -1440,6 +1476,12 @@ export interface LiveActivityStreamDeleteRequest {
|
|
|
1440
1476
|
* @memberof LiveActivityStreamDeleteRequest
|
|
1441
1477
|
*/
|
|
1442
1478
|
alert?: AlertPayload;
|
|
1479
|
+
/**
|
|
1480
|
+
* Optional sound for the end. Ends are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith 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`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
1481
|
+
* @type {string}
|
|
1482
|
+
* @memberof LiveActivityStreamDeleteRequest
|
|
1483
|
+
*/
|
|
1484
|
+
sound?: string;
|
|
1443
1485
|
}
|
|
1444
1486
|
/**
|
|
1445
1487
|
* Returned after a managed stream is ended and removed.
|
|
@@ -1703,6 +1745,12 @@ export interface LiveActivityStreamRequest {
|
|
|
1703
1745
|
* @memberof LiveActivityStreamRequest
|
|
1704
1746
|
*/
|
|
1705
1747
|
tags?: Array<string>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Optional sound for this call. A call that starts a Live Activity plays the Live Activities sound picked on the device unless you set one. Updates are silent unless you set one. A sound on an update also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith 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`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
1750
|
+
* @type {string}
|
|
1751
|
+
* @memberof LiveActivityStreamRequest
|
|
1752
|
+
*/
|
|
1753
|
+
sound?: string;
|
|
1706
1754
|
}
|
|
1707
1755
|
/**
|
|
1708
1756
|
* Update an existing Live Activity by activity_id.
|
|
@@ -1748,6 +1796,12 @@ export interface LiveActivityUpdateRequest {
|
|
|
1748
1796
|
* @memberof LiveActivityUpdateRequest
|
|
1749
1797
|
*/
|
|
1750
1798
|
secondary_action?: LiveActivityAction;
|
|
1799
|
+
/**
|
|
1800
|
+
* Optional sound for this update. Updates are silent unless you set one. A sound also expands the Live Activity on the Lock Screen. Sounds bundled with the ActivitySmith 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`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
1801
|
+
* @type {string}
|
|
1802
|
+
* @memberof LiveActivityUpdateRequest
|
|
1803
|
+
*/
|
|
1804
|
+
sound?: string;
|
|
1751
1805
|
}
|
|
1752
1806
|
/**
|
|
1753
1807
|
* Returned after a Live Activity update is sent or queued.
|
|
@@ -2159,7 +2213,7 @@ export interface PushNotificationAction {
|
|
|
2159
2213
|
*/
|
|
2160
2214
|
type: PushNotificationActionType;
|
|
2161
2215
|
/**
|
|
2162
|
-
* Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes
|
|
2216
|
+
* Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes have no web fallback. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend.
|
|
2163
2217
|
* @type {string}
|
|
2164
2218
|
* @memberof PushNotificationAction
|
|
2165
2219
|
*/
|
|
@@ -2257,7 +2311,7 @@ export interface PushNotificationReplaceRequest {
|
|
|
2257
2311
|
*/
|
|
2258
2312
|
media?: string;
|
|
2259
2313
|
/**
|
|
2260
|
-
* Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require
|
|
2314
|
+
* Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.
|
|
2261
2315
|
* @type {string}
|
|
2262
2316
|
* @memberof PushNotificationReplaceRequest
|
|
2263
2317
|
*/
|
|
@@ -2388,7 +2442,7 @@ export interface PushNotificationRequest {
|
|
|
2388
2442
|
*/
|
|
2389
2443
|
media?: string;
|
|
2390
2444
|
/**
|
|
2391
|
-
* Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require
|
|
2445
|
+
* Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media.
|
|
2392
2446
|
* @type {string}
|
|
2393
2447
|
* @memberof PushNotificationRequest
|
|
2394
2448
|
*/
|
|
@@ -2412,7 +2466,7 @@ export interface PushNotificationRequest {
|
|
|
2412
2466
|
*/
|
|
2413
2467
|
badge?: number;
|
|
2414
2468
|
/**
|
|
2415
|
-
*
|
|
2469
|
+
* Optional sound for this Push Notification. Omit it to play the Push Notifications sound picked on the device. Passive Push Notifications play no sound. Sounds bundled with the ActivitySmith 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`, `zip`. Use `default` for the sound picked on the device, or `none` for no sound.
|
|
2416
2470
|
* @type {string}
|
|
2417
2471
|
* @memberof PushNotificationRequest
|
|
2418
2472
|
*/
|
|
@@ -2557,13 +2611,13 @@ export type RateLimitErrorCodeEnum = typeof RateLimitErrorCodeEnum[keyof typeof
|
|
|
2557
2611
|
*/
|
|
2558
2612
|
export type SendPushNotification429Response = LiveActivityLimitError | RateLimitError;
|
|
2559
2613
|
/**
|
|
2560
|
-
* Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer
|
|
2614
|
+
* Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds or timer_end_at to start or reset a bounded timer, and timer_start_at for a timer that started earlier. Omit them on later updates to preserve the existing timer window.
|
|
2561
2615
|
* @export
|
|
2562
2616
|
* @interface StreamContentState
|
|
2563
2617
|
*/
|
|
2564
2618
|
export interface StreamContentState {
|
|
2565
2619
|
/**
|
|
2566
|
-
*
|
|
2620
|
+
* Title shown on the Live Activity. Send an empty string to show no title.
|
|
2567
2621
|
* @type {string}
|
|
2568
2622
|
* @memberof StreamContentState
|
|
2569
2623
|
*/
|
|
@@ -2605,11 +2659,23 @@ export interface StreamContentState {
|
|
|
2605
2659
|
*/
|
|
2606
2660
|
upper_limit?: number;
|
|
2607
2661
|
/**
|
|
2608
|
-
* Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window
|
|
2662
|
+
* Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window, counted from timer_start_at when you send it. Omit it on later stream updates to preserve the existing timer window.
|
|
2609
2663
|
* @type {number}
|
|
2610
2664
|
* @memberof StreamContentState
|
|
2611
2665
|
*/
|
|
2612
2666
|
duration_seconds?: number;
|
|
2667
|
+
/**
|
|
2668
|
+
* Use with type=timer. ISO 8601 date and time when the timer started. It can be in the past, so a countdown that started earlier shows the time already gone in its progress bar. Defaults to the request time. Must not be in the future.
|
|
2669
|
+
* @type {string}
|
|
2670
|
+
* @memberof StreamContentState
|
|
2671
|
+
*/
|
|
2672
|
+
timer_start_at?: string;
|
|
2673
|
+
/**
|
|
2674
|
+
* Use with type=timer. ISO 8601 date and time when the countdown ends. Must be after timer_start_at, or in the future when timer_start_at is omitted. Send duration_seconds or timer_end_at, not both. On later stream updates, send timer_end_at alone to move the end and keep the current start.
|
|
2675
|
+
* @type {string}
|
|
2676
|
+
* @memberof StreamContentState
|
|
2677
|
+
*/
|
|
2678
|
+
timer_end_at?: string;
|
|
2613
2679
|
/**
|
|
2614
2680
|
* Use with type=timer. When true or omitted, the timer counts down from duration_seconds. Set false for an elapsed timer; omit duration_seconds for an open-ended elapsed timer.
|
|
2615
2681
|
* @type {boolean}
|
|
@@ -17,7 +17,7 @@ type StartRequestBody = Parameters<LiveActivitiesApi["startLiveActivity"]>[0]["l
|
|
|
17
17
|
type UpdateRequestBody = Parameters<LiveActivitiesApi["updateLiveActivity"]>[0]["liveActivityUpdateRequest"];
|
|
18
18
|
type EndRequestBody = Parameters<LiveActivitiesApi["endLiveActivity"]>[0]["liveActivityEndRequest"];
|
|
19
19
|
type StreamRequestBody = Parameters<LiveActivitiesApi["reconcileLiveActivityStream"]>[0]["liveActivityStreamRequest"];
|
|
20
|
-
type StreamDeleteRequestBody = Parameters<LiveActivitiesApi["endLiveActivityStream"]>[0]["liveActivityStreamDeleteRequest"]
|
|
20
|
+
type StreamDeleteRequestBody = NonNullable<Parameters<LiveActivitiesApi["endLiveActivityStream"]>[0]["liveActivityStreamDeleteRequest"]>;
|
|
21
21
|
type LiveInitOverrides = Parameters<LiveActivitiesApi["startLiveActivity"]>[1];
|
|
22
22
|
type MetricUpdateParameters = Parameters<MetricsApi["updateMetricValue"]>[0];
|
|
23
23
|
type MetricRawParameters = Parameters<MetricsApi["updateMetricValueRaw"]>[0];
|
|
@@ -74,6 +74,8 @@ export type LiveActivityContentState = Record<string, unknown> & {
|
|
|
74
74
|
color?: string;
|
|
75
75
|
duration_seconds?: number;
|
|
76
76
|
counts_down?: boolean;
|
|
77
|
+
timer_start_at?: string;
|
|
78
|
+
timer_end_at?: string;
|
|
77
79
|
};
|
|
78
80
|
type LiveActivityAlertIconOptions = {
|
|
79
81
|
color?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActivitySmith = exports.DevicesResource = exports.MetricsResource = exports.LiveActivitiesResource = exports.NotificationsResource = void 0;
|
|
4
4
|
const index_1 = require("../generated/index");
|
|
5
|
-
const SDK_VERSION = "1.
|
|
5
|
+
const SDK_VERSION = "1.16.0";
|
|
6
6
|
const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
|
|
7
7
|
const DEFAULT_SDK_NAME = "node";
|
|
8
8
|
const SDK_HEADER_VALUE = `${DEFAULT_SDK_NAME}-v${SDK_VERSION}`;
|