activitysmith 1.4.0 → 1.7.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 +113 -10
- package/dist/generated/apis/LiveActivitiesApi.d.ts +8 -8
- package/dist/generated/apis/LiveActivitiesApi.js +8 -8
- package/dist/generated/models/index.d.ts +101 -25
- package/dist/generated/models/index.js +8 -4
- package/dist/src/ActivitySmith.d.ts +5 -0
- package/dist/src/ActivitySmith.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction)
|
|
|
18
18
|
- [Start & Update Live Activity](#start--update-live-activity)
|
|
19
19
|
- [End Live Activity](#end-live-activity)
|
|
20
20
|
- [Live Activity Action](#live-activity-action)
|
|
21
|
+
- [Icons and Badges](#icons-and-badges)
|
|
22
|
+
- [Live Activity Colors](#live-activity-colors)
|
|
21
23
|
- [Channels](#channels)
|
|
22
24
|
- [Widgets](#widgets)
|
|
23
25
|
|
|
@@ -96,7 +98,7 @@ What will work:
|
|
|
96
98
|
<img src="https://cdn.activitysmith.com/features/actionable-push-notifications-2.png" alt="Actionable push notification example" width="680" />
|
|
97
99
|
</p>
|
|
98
100
|
|
|
99
|
-
|
|
101
|
+
Push notification `redirection` and `actions` are optional. Use them to open HTTPS URLs, run a specific iPhone Shortcut with `shortcuts://run-shortcut?name=...`, or trigger backend webhook workflows.
|
|
100
102
|
Webhooks are executed by the ActivitySmith backend.
|
|
101
103
|
|
|
102
104
|
```ts
|
|
@@ -110,6 +112,11 @@ await activitysmith.notifications.send({
|
|
|
110
112
|
type: "open_url",
|
|
111
113
|
url: "https://crm.example.com/customers/cus_9f3a1d",
|
|
112
114
|
},
|
|
115
|
+
{
|
|
116
|
+
title: "Chat with Jarvis",
|
|
117
|
+
type: "open_url",
|
|
118
|
+
url: "shortcuts://run-shortcut?name=Jarvis",
|
|
119
|
+
},
|
|
113
120
|
{
|
|
114
121
|
title: "Start Onboarding Workflow",
|
|
115
122
|
type: "webhook",
|
|
@@ -126,13 +133,14 @@ await activitysmith.notifications.send({
|
|
|
126
133
|
|
|
127
134
|
## Live Activities
|
|
128
135
|
|
|
129
|
-
There are
|
|
136
|
+
There are six types of Live Activities:
|
|
130
137
|
|
|
131
138
|
- `stats`: best for showing business numbers side by side, such as revenue, sales, new users, conversion, refunds, or any other value you want visible at a glance
|
|
132
139
|
- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
|
|
133
140
|
- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
|
|
134
141
|
- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
|
|
135
142
|
- `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states
|
|
143
|
+
- `timer`: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs
|
|
136
144
|
|
|
137
145
|
### Start & Update Live Activity
|
|
138
146
|
|
|
@@ -235,13 +243,27 @@ await activitysmith.liveActivities.stream("customer-ops", {
|
|
|
235
243
|
});
|
|
236
244
|
```
|
|
237
245
|
|
|
238
|
-
|
|
246
|
+
#### Timer
|
|
239
247
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
248
|
+
<p align="center">
|
|
249
|
+
<img src="https://cdn.activitysmith.com/features/timer-live-activity.png" alt="Timer Live Activity showing a benchmark run countdown" width="680" />
|
|
250
|
+
</p>
|
|
243
251
|
|
|
244
|
-
|
|
252
|
+
```ts
|
|
253
|
+
await activitysmith.liveActivities.stream("benchmark-run", {
|
|
254
|
+
content_state: {
|
|
255
|
+
title: "Benchmark Run",
|
|
256
|
+
subtitle: "sampling",
|
|
257
|
+
type: "timer",
|
|
258
|
+
duration_seconds: 300,
|
|
259
|
+
color: "cyan",
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `color`, or any other visible field as the work changes. Leave `duration_seconds` out unless you want to change the timer.
|
|
265
|
+
|
|
266
|
+
To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`.
|
|
245
267
|
|
|
246
268
|
### End Live Activity
|
|
247
269
|
|
|
@@ -264,8 +286,11 @@ await activitysmith.liveActivities.endStream("prod-web-1", {
|
|
|
264
286
|
|
|
265
287
|
### Live Activity Action
|
|
266
288
|
|
|
267
|
-
Live Activities can include one optional action button.
|
|
268
|
-
|
|
289
|
+
Live Activities can include one optional action button.
|
|
290
|
+
|
|
291
|
+
- `open_url`: open an HTTPS URL.
|
|
292
|
+
- `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app.
|
|
293
|
+
- `webhook`: trigger a backend GET/POST workflow.
|
|
269
294
|
|
|
270
295
|
<p align="center">
|
|
271
296
|
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action button" width="680" />
|
|
@@ -285,13 +310,32 @@ await activitysmith.liveActivities.stream("prod-web-1", {
|
|
|
285
310
|
],
|
|
286
311
|
},
|
|
287
312
|
action: {
|
|
288
|
-
title: "
|
|
313
|
+
title: "Dashboard",
|
|
289
314
|
type: "open_url",
|
|
290
315
|
url: "https://ops.example.com/servers/prod-web-1",
|
|
291
316
|
},
|
|
292
317
|
});
|
|
293
318
|
```
|
|
294
319
|
|
|
320
|
+
#### Apple Shortcut action
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
await activitysmith.liveActivities.stream("deploy-payments-api", {
|
|
324
|
+
content_state: {
|
|
325
|
+
title: "Deploying payments-api",
|
|
326
|
+
subtitle: "Running database migrations",
|
|
327
|
+
type: "segmented_progress",
|
|
328
|
+
number_of_steps: 5,
|
|
329
|
+
current_step: 3,
|
|
330
|
+
},
|
|
331
|
+
action: {
|
|
332
|
+
title: "Chat with Jarvis",
|
|
333
|
+
type: "open_url",
|
|
334
|
+
url: "shortcuts://run-shortcut?name=Jarvis",
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
```
|
|
338
|
+
|
|
295
339
|
#### Webhook action
|
|
296
340
|
|
|
297
341
|
```ts
|
|
@@ -316,6 +360,65 @@ await activitysmith.liveActivities.stream("search-reindex", {
|
|
|
316
360
|
});
|
|
317
361
|
```
|
|
318
362
|
|
|
363
|
+
### Icons and Badges
|
|
364
|
+
|
|
365
|
+
Add more context to Live Activities with icons and badges.
|
|
366
|
+
|
|
367
|
+
#### Icon
|
|
368
|
+
|
|
369
|
+
Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
|
|
370
|
+
|
|
371
|
+
<p align="center">
|
|
372
|
+
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png" alt="Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen" width="680" />
|
|
373
|
+
</p>
|
|
374
|
+
|
|
375
|
+
```ts
|
|
376
|
+
await activitysmith.liveActivities.stream("prod-web-1", {
|
|
377
|
+
content_state: ActivitySmith.contentState({
|
|
378
|
+
title: "Server Health",
|
|
379
|
+
subtitle: "prod-web-1",
|
|
380
|
+
type: "metrics",
|
|
381
|
+
icon: ActivitySmith.alertIcon("server.rack", { color: "blue" }),
|
|
382
|
+
metrics: [
|
|
383
|
+
{ label: "CPU", value: 18, unit: "%" },
|
|
384
|
+
{ label: "MEM", value: 42, unit: "%" },
|
|
385
|
+
],
|
|
386
|
+
}),
|
|
387
|
+
});
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
The `icon.symbol` value is an Apple SF Symbol name. Browse the catalog with one of these tools:
|
|
391
|
+
|
|
392
|
+
- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use
|
|
393
|
+
- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app
|
|
394
|
+
- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography
|
|
395
|
+
|
|
396
|
+
#### Badge
|
|
397
|
+
|
|
398
|
+
Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities.
|
|
399
|
+
|
|
400
|
+
<p align="center">
|
|
401
|
+
<img src="https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png" alt="Progress Live Activity with a badge on the iPhone Lock Screen" width="680" />
|
|
402
|
+
</p>
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
await activitysmith.liveActivities.stream("nightly-database-backup", {
|
|
406
|
+
content_state: ActivitySmith.contentState({
|
|
407
|
+
title: "Nightly Database Backup",
|
|
408
|
+
subtitle: "verify restore",
|
|
409
|
+
type: "progress",
|
|
410
|
+
badge: ActivitySmith.alertBadge("S3", { color: "cyan" }),
|
|
411
|
+
percentage: 62,
|
|
412
|
+
}),
|
|
413
|
+
});
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Live Activity Colors
|
|
417
|
+
|
|
418
|
+
Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge:
|
|
419
|
+
|
|
420
|
+
`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray`
|
|
421
|
+
|
|
319
422
|
## Channels
|
|
320
423
|
|
|
321
424
|
Channels are used to target specific team members or devices. Can be used for both push notifications and live activities.
|
|
@@ -33,12 +33,12 @@ export interface UpdateLiveActivityRequest {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
35
35
|
/**
|
|
36
|
-
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, and
|
|
36
|
+
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
37
37
|
* End a Live Activity (legacy manual lifecycle)
|
|
38
38
|
*/
|
|
39
39
|
endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityEndResponse>>;
|
|
40
40
|
/**
|
|
41
|
-
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, and
|
|
41
|
+
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
42
42
|
* End a Live Activity (legacy manual lifecycle)
|
|
43
43
|
*/
|
|
44
44
|
endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityEndResponse>;
|
|
@@ -53,32 +53,32 @@ 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.
|
|
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; omit duration_seconds on later updates to preserve the existing timer window.
|
|
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.
|
|
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; omit duration_seconds on later updates to preserve the existing timer window.
|
|
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>;
|
|
65
65
|
/**
|
|
66
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, and
|
|
66
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
67
67
|
* Start a Live Activity (legacy manual lifecycle)
|
|
68
68
|
*/
|
|
69
69
|
startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStartResponse>>;
|
|
70
70
|
/**
|
|
71
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, and
|
|
71
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
72
72
|
* Start a Live Activity (legacy manual lifecycle)
|
|
73
73
|
*/
|
|
74
74
|
startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse>;
|
|
75
75
|
/**
|
|
76
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, and
|
|
76
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running.
|
|
77
77
|
* Update a Live Activity (legacy manual lifecycle)
|
|
78
78
|
*/
|
|
79
79
|
updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityUpdateResponse>>;
|
|
80
80
|
/**
|
|
81
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, and
|
|
81
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running.
|
|
82
82
|
* Update a Live Activity (legacy manual lifecycle)
|
|
83
83
|
*/
|
|
84
84
|
updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityUpdateResponse>;
|
|
@@ -20,7 +20,7 @@ const runtime = require("../runtime");
|
|
|
20
20
|
*/
|
|
21
21
|
class LiveActivitiesApi extends runtime.BaseAPI {
|
|
22
22
|
/**
|
|
23
|
-
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, and
|
|
23
|
+
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
24
24
|
* End a Live Activity (legacy manual lifecycle)
|
|
25
25
|
*/
|
|
26
26
|
async endLiveActivityRaw(requestParameters, initOverrides) {
|
|
@@ -47,7 +47,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
47
47
|
return new runtime.JSONApiResponse(response);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, and
|
|
50
|
+
* Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
51
51
|
* End a Live Activity (legacy manual lifecycle)
|
|
52
52
|
*/
|
|
53
53
|
async endLiveActivity(requestParameters, initOverrides) {
|
|
@@ -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.
|
|
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; omit duration_seconds on later updates to preserve the existing timer window.
|
|
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.
|
|
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; omit duration_seconds on later updates to preserve the existing timer window.
|
|
124
124
|
* Start a new Live Activity or update an existing one
|
|
125
125
|
*/
|
|
126
126
|
async reconcileLiveActivityStream(requestParameters, initOverrides) {
|
|
@@ -128,7 +128,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
128
128
|
return await response.value();
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, and
|
|
131
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
132
132
|
* Start a Live Activity (legacy manual lifecycle)
|
|
133
133
|
*/
|
|
134
134
|
async startLiveActivityRaw(requestParameters, initOverrides) {
|
|
@@ -155,7 +155,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
155
155
|
return new runtime.JSONApiResponse(response);
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, and
|
|
158
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
159
159
|
* Start a Live Activity (legacy manual lifecycle)
|
|
160
160
|
*/
|
|
161
161
|
async startLiveActivity(requestParameters, initOverrides) {
|
|
@@ -163,7 +163,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
163
163
|
return await response.value();
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, and
|
|
166
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running.
|
|
167
167
|
* Update a Live Activity (legacy manual lifecycle)
|
|
168
168
|
*/
|
|
169
169
|
async updateLiveActivityRaw(requestParameters, initOverrides) {
|
|
@@ -190,7 +190,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
190
190
|
return new runtime.JSONApiResponse(response);
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
|
-
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, and
|
|
193
|
+
* Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running.
|
|
194
194
|
* Update a Live Activity (legacy manual lifecycle)
|
|
195
195
|
*/
|
|
196
196
|
async updateLiveActivity(requestParameters, initOverrides) {
|
|
@@ -107,7 +107,7 @@ export interface ChannelTarget {
|
|
|
107
107
|
channels: Array<string>;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
|
-
* End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message,
|
|
110
|
+
* End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
|
|
111
111
|
* @export
|
|
112
112
|
* @interface ContentStateEnd
|
|
113
113
|
*/
|
|
@@ -132,7 +132,7 @@ export interface ContentStateEnd {
|
|
|
132
132
|
*/
|
|
133
133
|
number_of_steps?: number;
|
|
134
134
|
/**
|
|
135
|
-
* Current step. Use for type=segmented_progress.
|
|
135
|
+
* Current completed step count. Use for type=segmented_progress. Must be less than or equal to number_of_steps when number_of_steps is provided.
|
|
136
136
|
* @type {number}
|
|
137
137
|
* @memberof ContentStateEnd
|
|
138
138
|
*/
|
|
@@ -155,6 +155,24 @@ export interface ContentStateEnd {
|
|
|
155
155
|
* @memberof ContentStateEnd
|
|
156
156
|
*/
|
|
157
157
|
upper_limit?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Timer duration in seconds. For type=timer, omit duration_seconds on end to preserve and freeze the latest timer state.
|
|
160
|
+
* @type {number}
|
|
161
|
+
* @memberof ContentStateEnd
|
|
162
|
+
*/
|
|
163
|
+
duration_seconds?: number;
|
|
164
|
+
/**
|
|
165
|
+
* 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.
|
|
166
|
+
* @type {boolean}
|
|
167
|
+
* @memberof ContentStateEnd
|
|
168
|
+
*/
|
|
169
|
+
counts_down?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
|
|
172
|
+
* @type {boolean}
|
|
173
|
+
* @memberof ContentStateEnd
|
|
174
|
+
*/
|
|
175
|
+
is_running?: boolean;
|
|
158
176
|
/**
|
|
159
177
|
* Use for type=metrics or type=stats.
|
|
160
178
|
* @type {Array<ActivityMetric>}
|
|
@@ -168,13 +186,13 @@ export interface ContentStateEnd {
|
|
|
168
186
|
*/
|
|
169
187
|
message?: string;
|
|
170
188
|
/**
|
|
171
|
-
* Optional SF Symbol icon
|
|
189
|
+
* Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
172
190
|
* @type {LiveActivityAlertIcon}
|
|
173
191
|
* @memberof ContentStateEnd
|
|
174
192
|
*/
|
|
175
193
|
icon?: LiveActivityAlertIcon;
|
|
176
194
|
/**
|
|
177
|
-
* Optional badge
|
|
195
|
+
* Optional badge. Supported by alert, progress, and segmented_progress.
|
|
178
196
|
* @type {LiveActivityAlertBadge}
|
|
179
197
|
* @memberof ContentStateEnd
|
|
180
198
|
*/
|
|
@@ -186,7 +204,7 @@ export interface ContentStateEnd {
|
|
|
186
204
|
*/
|
|
187
205
|
type?: ContentStateEndTypeEnum;
|
|
188
206
|
/**
|
|
189
|
-
* Optional. Accent color for progress, segmented_progress, and
|
|
207
|
+
* Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
|
|
190
208
|
* @type {string}
|
|
191
209
|
* @memberof ContentStateEnd
|
|
192
210
|
*/
|
|
@@ -219,6 +237,7 @@ export declare const ContentStateEndTypeEnum: {
|
|
|
219
237
|
readonly Metrics: "metrics";
|
|
220
238
|
readonly Stats: "stats";
|
|
221
239
|
readonly Alert: "alert";
|
|
240
|
+
readonly Timer: "timer";
|
|
222
241
|
};
|
|
223
242
|
export type ContentStateEndTypeEnum = typeof ContentStateEndTypeEnum[keyof typeof ContentStateEndTypeEnum];
|
|
224
243
|
/**
|
|
@@ -270,7 +289,7 @@ export declare const ContentStateEndStepColorsEnum: {
|
|
|
270
289
|
};
|
|
271
290
|
export type ContentStateEndStepColorsEnum = typeof ContentStateEndStepColorsEnum[keyof typeof ContentStateEndStepColorsEnum];
|
|
272
291
|
/**
|
|
273
|
-
* 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 alert include message,
|
|
292
|
+
* 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 alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
274
293
|
* @export
|
|
275
294
|
* @interface ContentStateStart
|
|
276
295
|
*/
|
|
@@ -295,7 +314,7 @@ export interface ContentStateStart {
|
|
|
295
314
|
*/
|
|
296
315
|
number_of_steps?: number;
|
|
297
316
|
/**
|
|
298
|
-
* Current step. Use for type=segmented_progress.
|
|
317
|
+
* Current completed step count. Use for type=segmented_progress. Set 0 when the activity has started but no segment is complete yet. Must be less than or equal to number_of_steps.
|
|
299
318
|
* @type {number}
|
|
300
319
|
* @memberof ContentStateStart
|
|
301
320
|
*/
|
|
@@ -318,6 +337,24 @@ export interface ContentStateStart {
|
|
|
318
337
|
* @memberof ContentStateStart
|
|
319
338
|
*/
|
|
320
339
|
upper_limit?: number;
|
|
340
|
+
/**
|
|
341
|
+
* Timer duration in seconds. For type=timer countdowns, required on start when counts_down is true or omitted.
|
|
342
|
+
* @type {number}
|
|
343
|
+
* @memberof ContentStateStart
|
|
344
|
+
*/
|
|
345
|
+
duration_seconds?: number;
|
|
346
|
+
/**
|
|
347
|
+
* 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.
|
|
348
|
+
* @type {boolean}
|
|
349
|
+
* @memberof ContentStateStart
|
|
350
|
+
*/
|
|
351
|
+
counts_down?: boolean;
|
|
352
|
+
/**
|
|
353
|
+
* Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
|
|
354
|
+
* @type {boolean}
|
|
355
|
+
* @memberof ContentStateStart
|
|
356
|
+
*/
|
|
357
|
+
is_running?: boolean;
|
|
321
358
|
/**
|
|
322
359
|
* Use for type=metrics or type=stats.
|
|
323
360
|
* @type {Array<ActivityMetric>}
|
|
@@ -331,13 +368,13 @@ export interface ContentStateStart {
|
|
|
331
368
|
*/
|
|
332
369
|
message?: string;
|
|
333
370
|
/**
|
|
334
|
-
* Optional SF Symbol icon
|
|
371
|
+
* Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
335
372
|
* @type {LiveActivityAlertIcon}
|
|
336
373
|
* @memberof ContentStateStart
|
|
337
374
|
*/
|
|
338
375
|
icon?: LiveActivityAlertIcon;
|
|
339
376
|
/**
|
|
340
|
-
* Optional badge
|
|
377
|
+
* Optional badge. Supported by alert, progress, and segmented_progress.
|
|
341
378
|
* @type {LiveActivityAlertBadge}
|
|
342
379
|
* @memberof ContentStateStart
|
|
343
380
|
*/
|
|
@@ -349,7 +386,7 @@ export interface ContentStateStart {
|
|
|
349
386
|
*/
|
|
350
387
|
type: ContentStateStartTypeEnum;
|
|
351
388
|
/**
|
|
352
|
-
* Optional. Accent color for progress, segmented_progress, and
|
|
389
|
+
* Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
|
|
353
390
|
* @type {string}
|
|
354
391
|
* @memberof ContentStateStart
|
|
355
392
|
*/
|
|
@@ -376,6 +413,7 @@ export declare const ContentStateStartTypeEnum: {
|
|
|
376
413
|
readonly Metrics: "metrics";
|
|
377
414
|
readonly Stats: "stats";
|
|
378
415
|
readonly Alert: "alert";
|
|
416
|
+
readonly Timer: "timer";
|
|
379
417
|
};
|
|
380
418
|
export type ContentStateStartTypeEnum = typeof ContentStateStartTypeEnum[keyof typeof ContentStateStartTypeEnum];
|
|
381
419
|
/**
|
|
@@ -427,7 +465,7 @@ export declare const ContentStateStartStepColorsEnum: {
|
|
|
427
465
|
};
|
|
428
466
|
export type ContentStateStartStepColorsEnum = typeof ContentStateStartStepColorsEnum[keyof typeof ContentStateStartStepColorsEnum];
|
|
429
467
|
/**
|
|
430
|
-
* Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message,
|
|
468
|
+
* Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
|
|
431
469
|
* @export
|
|
432
470
|
* @interface ContentStateUpdate
|
|
433
471
|
*/
|
|
@@ -452,7 +490,7 @@ export interface ContentStateUpdate {
|
|
|
452
490
|
*/
|
|
453
491
|
number_of_steps?: number;
|
|
454
492
|
/**
|
|
455
|
-
* Current step. Use for type=segmented_progress.
|
|
493
|
+
* Current completed step count. Use for type=segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.
|
|
456
494
|
* @type {number}
|
|
457
495
|
* @memberof ContentStateUpdate
|
|
458
496
|
*/
|
|
@@ -475,6 +513,24 @@ export interface ContentStateUpdate {
|
|
|
475
513
|
* @memberof ContentStateUpdate
|
|
476
514
|
*/
|
|
477
515
|
upper_limit?: number;
|
|
516
|
+
/**
|
|
517
|
+
* Timer duration in seconds. For type=timer, sending duration_seconds resets the timer window from the update request time; omit it to preserve the existing timer window.
|
|
518
|
+
* @type {number}
|
|
519
|
+
* @memberof ContentStateUpdate
|
|
520
|
+
*/
|
|
521
|
+
duration_seconds?: number;
|
|
522
|
+
/**
|
|
523
|
+
* 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.
|
|
524
|
+
* @type {boolean}
|
|
525
|
+
* @memberof ContentStateUpdate
|
|
526
|
+
*/
|
|
527
|
+
counts_down?: boolean;
|
|
528
|
+
/**
|
|
529
|
+
* Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
|
|
530
|
+
* @type {boolean}
|
|
531
|
+
* @memberof ContentStateUpdate
|
|
532
|
+
*/
|
|
533
|
+
is_running?: boolean;
|
|
478
534
|
/**
|
|
479
535
|
* Use for type=metrics or type=stats.
|
|
480
536
|
* @type {Array<ActivityMetric>}
|
|
@@ -488,13 +544,13 @@ export interface ContentStateUpdate {
|
|
|
488
544
|
*/
|
|
489
545
|
message?: string;
|
|
490
546
|
/**
|
|
491
|
-
* Optional SF Symbol icon
|
|
547
|
+
* Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
492
548
|
* @type {LiveActivityAlertIcon}
|
|
493
549
|
* @memberof ContentStateUpdate
|
|
494
550
|
*/
|
|
495
551
|
icon?: LiveActivityAlertIcon;
|
|
496
552
|
/**
|
|
497
|
-
* Optional badge
|
|
553
|
+
* Optional badge. Supported by alert, progress, and segmented_progress.
|
|
498
554
|
* @type {LiveActivityAlertBadge}
|
|
499
555
|
* @memberof ContentStateUpdate
|
|
500
556
|
*/
|
|
@@ -506,7 +562,7 @@ export interface ContentStateUpdate {
|
|
|
506
562
|
*/
|
|
507
563
|
type?: ContentStateUpdateTypeEnum;
|
|
508
564
|
/**
|
|
509
|
-
* Optional. Accent color for progress, segmented_progress, and
|
|
565
|
+
* Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
|
|
510
566
|
* @type {string}
|
|
511
567
|
* @memberof ContentStateUpdate
|
|
512
568
|
*/
|
|
@@ -533,6 +589,7 @@ export declare const ContentStateUpdateTypeEnum: {
|
|
|
533
589
|
readonly Metrics: "metrics";
|
|
534
590
|
readonly Stats: "stats";
|
|
535
591
|
readonly Alert: "alert";
|
|
592
|
+
readonly Timer: "timer";
|
|
536
593
|
};
|
|
537
594
|
export type ContentStateUpdateTypeEnum = typeof ContentStateUpdateTypeEnum[keyof typeof ContentStateUpdateTypeEnum];
|
|
538
595
|
/**
|
|
@@ -623,7 +680,7 @@ export interface LiveActivityAction {
|
|
|
623
680
|
*/
|
|
624
681
|
type: LiveActivityActionType;
|
|
625
682
|
/**
|
|
626
|
-
*
|
|
683
|
+
* Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
|
|
627
684
|
* @type {string}
|
|
628
685
|
* @memberof LiveActivityAction
|
|
629
686
|
*/
|
|
@@ -653,7 +710,7 @@ export declare const LiveActivityActionType: {
|
|
|
653
710
|
};
|
|
654
711
|
export type LiveActivityActionType = typeof LiveActivityActionType[keyof typeof LiveActivityActionType];
|
|
655
712
|
/**
|
|
656
|
-
* Optional badge for
|
|
713
|
+
* Optional badge for Live Activities.
|
|
657
714
|
* @export
|
|
658
715
|
* @interface LiveActivityAlertBadge
|
|
659
716
|
*/
|
|
@@ -673,7 +730,7 @@ export interface LiveActivityAlertBadge {
|
|
|
673
730
|
color?: LiveActivityColor;
|
|
674
731
|
}
|
|
675
732
|
/**
|
|
676
|
-
* Optional SF Symbol icon for
|
|
733
|
+
* Optional SF Symbol icon for Live Activities.
|
|
677
734
|
* @export
|
|
678
735
|
* @interface LiveActivityAlertIcon
|
|
679
736
|
*/
|
|
@@ -1280,7 +1337,7 @@ export interface PushNotificationAction {
|
|
|
1280
1337
|
*/
|
|
1281
1338
|
type: PushNotificationActionType;
|
|
1282
1339
|
/**
|
|
1283
|
-
*
|
|
1340
|
+
* Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend.
|
|
1284
1341
|
* @type {string}
|
|
1285
1342
|
* @memberof PushNotificationAction
|
|
1286
1343
|
*/
|
|
@@ -1341,7 +1398,7 @@ export interface PushNotificationRequest {
|
|
|
1341
1398
|
*/
|
|
1342
1399
|
media?: string;
|
|
1343
1400
|
/**
|
|
1344
|
-
* Optional HTTPS URL opened when user taps the notification body. Overrides the default tap target from `media` when both are provided.
|
|
1401
|
+
* Optional HTTPS URL or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided.
|
|
1345
1402
|
* @type {string}
|
|
1346
1403
|
* @memberof PushNotificationRequest
|
|
1347
1404
|
*/
|
|
@@ -1453,7 +1510,7 @@ export interface RateLimitError {
|
|
|
1453
1510
|
*/
|
|
1454
1511
|
export type SendPushNotification429Response = LiveActivityLimitError | RateLimitError;
|
|
1455
1512
|
/**
|
|
1456
|
-
* 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, and
|
|
1513
|
+
* 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, and timer types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window.
|
|
1457
1514
|
* @export
|
|
1458
1515
|
* @interface StreamContentState
|
|
1459
1516
|
*/
|
|
@@ -1478,7 +1535,7 @@ export interface StreamContentState {
|
|
|
1478
1535
|
*/
|
|
1479
1536
|
number_of_steps?: number;
|
|
1480
1537
|
/**
|
|
1481
|
-
* Use for segmented_progress.
|
|
1538
|
+
* Use for segmented_progress. Set 0 when no segment is complete yet. Must be less than or equal to number_of_steps when number_of_steps is provided.
|
|
1482
1539
|
* @type {number}
|
|
1483
1540
|
* @memberof StreamContentState
|
|
1484
1541
|
*/
|
|
@@ -1501,6 +1558,24 @@ export interface StreamContentState {
|
|
|
1501
1558
|
* @memberof StreamContentState
|
|
1502
1559
|
*/
|
|
1503
1560
|
upper_limit?: number;
|
|
1561
|
+
/**
|
|
1562
|
+
* Timer duration in seconds. For type=timer, send duration_seconds to start or reset the timer window; omit it on later stream updates to preserve the existing timer window.
|
|
1563
|
+
* @type {number}
|
|
1564
|
+
* @memberof StreamContentState
|
|
1565
|
+
*/
|
|
1566
|
+
duration_seconds?: number;
|
|
1567
|
+
/**
|
|
1568
|
+
* 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.
|
|
1569
|
+
* @type {boolean}
|
|
1570
|
+
* @memberof StreamContentState
|
|
1571
|
+
*/
|
|
1572
|
+
counts_down?: boolean;
|
|
1573
|
+
/**
|
|
1574
|
+
* Use with type=timer. Defaults to true. Set false to pause/freeze via API; set true on a paused timer to resume.
|
|
1575
|
+
* @type {boolean}
|
|
1576
|
+
* @memberof StreamContentState
|
|
1577
|
+
*/
|
|
1578
|
+
is_running?: boolean;
|
|
1504
1579
|
/**
|
|
1505
1580
|
* Required on the first PUT or whenever the stream cannot infer the current activity type.
|
|
1506
1581
|
* @type {string}
|
|
@@ -1508,7 +1583,7 @@ export interface StreamContentState {
|
|
|
1508
1583
|
*/
|
|
1509
1584
|
type?: StreamContentStateTypeEnum;
|
|
1510
1585
|
/**
|
|
1511
|
-
* Optional. Accent color for progress, segmented_progress, and
|
|
1586
|
+
* Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints the action button when action is included.
|
|
1512
1587
|
* @type {string}
|
|
1513
1588
|
* @memberof StreamContentState
|
|
1514
1589
|
*/
|
|
@@ -1538,13 +1613,13 @@ export interface StreamContentState {
|
|
|
1538
1613
|
*/
|
|
1539
1614
|
message?: string;
|
|
1540
1615
|
/**
|
|
1541
|
-
* Optional SF Symbol icon
|
|
1616
|
+
* Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer.
|
|
1542
1617
|
* @type {LiveActivityAlertIcon}
|
|
1543
1618
|
* @memberof StreamContentState
|
|
1544
1619
|
*/
|
|
1545
1620
|
icon?: LiveActivityAlertIcon;
|
|
1546
1621
|
/**
|
|
1547
|
-
* Optional badge
|
|
1622
|
+
* Optional badge. Supported by alert, progress, and segmented_progress.
|
|
1548
1623
|
* @type {LiveActivityAlertBadge}
|
|
1549
1624
|
* @memberof StreamContentState
|
|
1550
1625
|
*/
|
|
@@ -1571,6 +1646,7 @@ export declare const StreamContentStateTypeEnum: {
|
|
|
1571
1646
|
readonly Metrics: "metrics";
|
|
1572
1647
|
readonly Stats: "stats";
|
|
1573
1648
|
readonly Alert: "alert";
|
|
1649
|
+
readonly Timer: "timer";
|
|
1574
1650
|
};
|
|
1575
1651
|
export type StreamContentStateTypeEnum = typeof StreamContentStateTypeEnum[keyof typeof StreamContentStateTypeEnum];
|
|
1576
1652
|
/**
|
|
@@ -24,7 +24,8 @@ exports.ContentStateEndTypeEnum = {
|
|
|
24
24
|
Progress: 'progress',
|
|
25
25
|
Metrics: 'metrics',
|
|
26
26
|
Stats: 'stats',
|
|
27
|
-
Alert: 'alert'
|
|
27
|
+
Alert: 'alert',
|
|
28
|
+
Timer: 'timer'
|
|
28
29
|
};
|
|
29
30
|
/**
|
|
30
31
|
* @export
|
|
@@ -79,7 +80,8 @@ exports.ContentStateStartTypeEnum = {
|
|
|
79
80
|
Progress: 'progress',
|
|
80
81
|
Metrics: 'metrics',
|
|
81
82
|
Stats: 'stats',
|
|
82
|
-
Alert: 'alert'
|
|
83
|
+
Alert: 'alert',
|
|
84
|
+
Timer: 'timer'
|
|
83
85
|
};
|
|
84
86
|
/**
|
|
85
87
|
* @export
|
|
@@ -134,7 +136,8 @@ exports.ContentStateUpdateTypeEnum = {
|
|
|
134
136
|
Progress: 'progress',
|
|
135
137
|
Metrics: 'metrics',
|
|
136
138
|
Stats: 'stats',
|
|
137
|
-
Alert: 'alert'
|
|
139
|
+
Alert: 'alert',
|
|
140
|
+
Timer: 'timer'
|
|
138
141
|
};
|
|
139
142
|
/**
|
|
140
143
|
* @export
|
|
@@ -253,7 +256,8 @@ exports.StreamContentStateTypeEnum = {
|
|
|
253
256
|
Progress: 'progress',
|
|
254
257
|
Metrics: 'metrics',
|
|
255
258
|
Stats: 'stats',
|
|
256
|
-
Alert: 'alert'
|
|
259
|
+
Alert: 'alert',
|
|
260
|
+
Timer: 'timer'
|
|
257
261
|
};
|
|
258
262
|
/**
|
|
259
263
|
* @export
|
|
@@ -27,6 +27,7 @@ declare const LiveActivityTypes: {
|
|
|
27
27
|
readonly metrics: "metrics";
|
|
28
28
|
readonly stats: "stats";
|
|
29
29
|
readonly alert: "alert";
|
|
30
|
+
readonly timer: "timer";
|
|
30
31
|
};
|
|
31
32
|
export type LiveActivityType = (typeof LiveActivityTypes)[keyof typeof LiveActivityTypes];
|
|
32
33
|
export type LiveActivityAlertIcon = {
|
|
@@ -45,6 +46,8 @@ export type LiveActivityContentState = Record<string, unknown> & {
|
|
|
45
46
|
icon?: LiveActivityAlertIcon;
|
|
46
47
|
badge?: LiveActivityAlertBadge;
|
|
47
48
|
color?: string;
|
|
49
|
+
duration_seconds?: number;
|
|
50
|
+
counts_down?: boolean;
|
|
48
51
|
};
|
|
49
52
|
type LiveActivityAlertIconOptions = {
|
|
50
53
|
color?: string;
|
|
@@ -86,6 +89,7 @@ export declare class LiveActivitiesResource {
|
|
|
86
89
|
readonly metrics: "metrics";
|
|
87
90
|
readonly stats: "stats";
|
|
88
91
|
readonly alert: "alert";
|
|
92
|
+
readonly timer: "timer";
|
|
89
93
|
};
|
|
90
94
|
private readonly api;
|
|
91
95
|
constructor(api: LiveActivitiesApi);
|
|
@@ -119,6 +123,7 @@ export declare class ActivitySmith {
|
|
|
119
123
|
readonly metrics: "metrics";
|
|
120
124
|
readonly stats: "stats";
|
|
121
125
|
readonly alert: "alert";
|
|
126
|
+
readonly timer: "timer";
|
|
122
127
|
};
|
|
123
128
|
static readonly contentState: typeof contentState;
|
|
124
129
|
static readonly alertIcon: typeof alertIcon;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActivitySmith = 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.7.0";
|
|
6
6
|
const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
|
|
7
7
|
const SDK_HEADER_VALUE = `node-v${SDK_VERSION}`;
|
|
8
8
|
const LiveActivityTypes = {
|
|
@@ -11,6 +11,7 @@ const LiveActivityTypes = {
|
|
|
11
11
|
metrics: "metrics",
|
|
12
12
|
stats: "stats",
|
|
13
13
|
alert: "alert",
|
|
14
|
+
timer: "timer",
|
|
14
15
|
};
|
|
15
16
|
function withTargetChannels(request) {
|
|
16
17
|
const channels = request.channels;
|