activitysmith 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -345
- package/dist/generated/apis/LiveActivitiesApi.d.ts +16 -16
- package/dist/generated/apis/LiveActivitiesApi.js +16 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,12 +15,8 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction)
|
|
|
15
15
|
- [Rich Push Notifications with Media](#rich-push-notifications-with-media)
|
|
16
16
|
- [Actionable Push Notifications](#actionable-push-notifications)
|
|
17
17
|
- [Live Activities](#live-activities)
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [Stats Type](#stats-type)
|
|
21
|
-
- [Metrics Type](#metrics-type)
|
|
22
|
-
- [Segmented Progress Type](#segmented-progress-type)
|
|
23
|
-
- [Progress Type](#progress-type)
|
|
18
|
+
- [Start & Update Live Activity](#start--update-live-activity)
|
|
19
|
+
- [End Live Activity](#end-live-activity)
|
|
24
20
|
- [Live Activity Action](#live-activity-action)
|
|
25
21
|
- [Channels](#channels)
|
|
26
22
|
- [Widgets](#widgets)
|
|
@@ -130,40 +126,25 @@ await activitysmith.notifications.send({
|
|
|
130
126
|
|
|
131
127
|
## Live Activities
|
|
132
128
|
|
|
133
|
-
<p align="center">
|
|
134
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity screenshot" width="680" />
|
|
135
|
-
</p>
|
|
136
|
-
|
|
137
129
|
There are four types of Live Activities:
|
|
138
130
|
|
|
139
|
-
- `stats`: best for
|
|
140
|
-
- `metrics`: best for live
|
|
141
|
-
- `segmented_progress`: best for
|
|
142
|
-
- `progress`: best for
|
|
143
|
-
|
|
144
|
-
When working with Live Activities via our API, you have two approaches tailored to different needs. First, the stateless mode is the simplest path - one API call can initiate or update an activity, and another ends it - no state tracking on your side.
|
|
145
|
-
|
|
146
|
-
This is ideal if you want minimal complexity, perfect for automated workflows like cron jobs.
|
|
147
|
-
|
|
148
|
-
In contrast, if you need precise lifecycle control, the classic approach offers distinct calls for start, updates, and end, giving you full control over the activity's state.
|
|
149
|
-
|
|
150
|
-
In the following sections, we'll break down how to implement each method so you can choose what fits your use case best.
|
|
131
|
+
- `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
|
+
- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
|
|
133
|
+
- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
|
|
134
|
+
- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
|
|
151
135
|
|
|
152
|
-
###
|
|
136
|
+
### Start & Update Live Activity
|
|
153
137
|
|
|
154
|
-
Use a stable `streamKey` to identify the
|
|
155
|
-
such as a server, deployment, or build pipeline.
|
|
156
|
-
This is especially useful for cron jobs and other scheduled tasks where you do
|
|
157
|
-
not want to store `activity_id` between runs.
|
|
138
|
+
Use a stable `streamKey` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `streamKey` update it.
|
|
158
139
|
|
|
159
140
|
#### Stats
|
|
160
141
|
|
|
161
142
|
<p align="center">
|
|
162
|
-
<img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats stream example" width="680" />
|
|
143
|
+
<img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats Live Activity stream example" width="680" />
|
|
163
144
|
</p>
|
|
164
145
|
|
|
165
146
|
```ts
|
|
166
|
-
|
|
147
|
+
await activitysmith.liveActivities.stream("sales-hourly", {
|
|
167
148
|
content_state: {
|
|
168
149
|
title: "Sales",
|
|
169
150
|
subtitle: "last hour",
|
|
@@ -183,11 +164,11 @@ const status = await activitysmith.liveActivities.stream("sales-hourly", {
|
|
|
183
164
|
#### Metrics
|
|
184
165
|
|
|
185
166
|
<p align="center">
|
|
186
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-start.png" alt="Metrics stream example" width="680" />
|
|
167
|
+
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-start.png" alt="Metrics Live Activity stream example" width="680" />
|
|
187
168
|
</p>
|
|
188
169
|
|
|
189
170
|
```ts
|
|
190
|
-
|
|
171
|
+
await activitysmith.liveActivities.stream("prod-web-1", {
|
|
191
172
|
content_state: {
|
|
192
173
|
title: "Server Health",
|
|
193
174
|
subtitle: "prod-web-1",
|
|
@@ -200,10 +181,10 @@ const status = await activitysmith.liveActivities.stream("prod-web-1", {
|
|
|
200
181
|
});
|
|
201
182
|
```
|
|
202
183
|
|
|
203
|
-
#### Segmented
|
|
184
|
+
#### Segmented Progress
|
|
204
185
|
|
|
205
186
|
<p align="center">
|
|
206
|
-
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented
|
|
187
|
+
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented Progress Live Activity stream example" width="680" />
|
|
207
188
|
</p>
|
|
208
189
|
|
|
209
190
|
```ts
|
|
@@ -221,7 +202,7 @@ await activitysmith.liveActivities.stream("nightly-backup", {
|
|
|
221
202
|
#### Progress
|
|
222
203
|
|
|
223
204
|
<p align="center">
|
|
224
|
-
<img src="https://cdn.activitysmith.com/features/progress-live-activity.png" alt="Progress stream example" width="680" />
|
|
205
|
+
<img src="https://cdn.activitysmith.com/features/progress-live-activity.png" alt="Progress Live Activity stream example" width="680" />
|
|
225
206
|
</p>
|
|
226
207
|
|
|
227
208
|
```ts
|
|
@@ -235,13 +216,9 @@ await activitysmith.liveActivities.stream("search-reindex", {
|
|
|
235
216
|
});
|
|
236
217
|
```
|
|
237
218
|
|
|
238
|
-
|
|
219
|
+
### End Live Activity
|
|
239
220
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
Use this when the tracked process is finished and you no longer want the Live
|
|
243
|
-
Activity on devices. `content_state` is optional here; include it if you want
|
|
244
|
-
to end the stream with a final state.
|
|
221
|
+
Call `endStream(...)` with the same `streamKey` to dismiss the Live Activity. You can include final values before it is removed. By default, iOS removes the Live Activity after two minutes. Set `auto_dismiss_minutes` to choose a different dismissal time, including `0` for immediate dismissal.
|
|
245
222
|
|
|
246
223
|
```ts
|
|
247
224
|
await activitysmith.liveActivities.endStream("prod-web-1", {
|
|
@@ -253,316 +230,23 @@ await activitysmith.liveActivities.endStream("prod-web-1", {
|
|
|
253
230
|
{ label: "CPU", value: 7, unit: "%" },
|
|
254
231
|
{ label: "MEM", value: 38, unit: "%" },
|
|
255
232
|
],
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
If you later send another `stream(...)` request with the same `streamKey`,
|
|
261
|
-
ActivitySmith starts a new Live Activity for that stream again.
|
|
262
|
-
|
|
263
|
-
Stream responses include an `operation` field:
|
|
264
|
-
|
|
265
|
-
- `started`: ActivitySmith started a new Live Activity for this `streamKey`
|
|
266
|
-
- `updated`: ActivitySmith updated the current Live Activity
|
|
267
|
-
- `rotated`: ActivitySmith ended the previous Live Activity and started a new one
|
|
268
|
-
- `noop`: the incoming state matched the current state, so no update was sent
|
|
269
|
-
- `paused`: the stream is paused, so no Live Activity was started or updated
|
|
270
|
-
- `ended`: returned by `endStream(...)` after the stream is ended
|
|
271
|
-
|
|
272
|
-
### Advanced: Full lifecycle control
|
|
273
|
-
|
|
274
|
-
Use these methods when you want to manage the Live Activity lifecycle yourself:
|
|
275
|
-
|
|
276
|
-
1. Call `activitysmith.liveActivities.start(...)`.
|
|
277
|
-
2. Save the returned `activity_id`.
|
|
278
|
-
3. Call `activitysmith.liveActivities.update(...)` as progress changes.
|
|
279
|
-
4. Call `activitysmith.liveActivities.end(...)` when the work is finished.
|
|
280
|
-
|
|
281
|
-
### Stats Type
|
|
282
|
-
|
|
283
|
-
Keep your key numbers on your Lock Screen. `stats` fits 1 to 8 labeled values,
|
|
284
|
-
such as revenue, orders, conversion, uptime, or any other business metric you
|
|
285
|
-
want visible at a glance. Each metric can use a formatted string or number as
|
|
286
|
-
its `value`. Add `color` to a metric to show an accent dot next to its label;
|
|
287
|
-
omit `color` to show the label without a dot.
|
|
288
|
-
|
|
289
|
-
#### Start
|
|
290
|
-
|
|
291
|
-
<p align="center">
|
|
292
|
-
<img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats Live Activity with sales revenue, orders, conversion, and average order value" width="680" />
|
|
293
|
-
</p>
|
|
294
|
-
|
|
295
|
-
```ts
|
|
296
|
-
const start = await activitysmith.liveActivities.start({
|
|
297
|
-
content_state: {
|
|
298
|
-
title: "Sales",
|
|
299
|
-
subtitle: "last hour",
|
|
300
|
-
type: "stats",
|
|
301
|
-
metrics: [
|
|
302
|
-
{ label: "Revenue", value: "$2430", color: "blue" },
|
|
303
|
-
{ label: "Orders", value: "37", color: "green" },
|
|
304
|
-
{ label: "Conversion", value: "4.8%", color: "magenta" },
|
|
305
|
-
{ label: "Avg Order", value: "$65.68", color: "yellow" },
|
|
306
|
-
{ label: "Refunds", value: "$84", color: "red" },
|
|
307
|
-
{ label: "New Buyers", value: "18", color: "cyan" },
|
|
308
|
-
],
|
|
309
|
-
},
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
const activityId = start.activity_id;
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
#### Update
|
|
316
|
-
|
|
317
|
-
```ts
|
|
318
|
-
await activitysmith.liveActivities.update({
|
|
319
|
-
activity_id: activityId,
|
|
320
|
-
content_state: {
|
|
321
|
-
title: "Sales",
|
|
322
|
-
subtitle: "last hour",
|
|
323
|
-
type: "stats",
|
|
324
|
-
metrics: [
|
|
325
|
-
{ label: "Revenue", value: "$3180", color: "blue" },
|
|
326
|
-
{ label: "Orders", value: "51", color: "green" },
|
|
327
|
-
{ label: "Conversion", value: "5.2%", color: "magenta" },
|
|
328
|
-
{ label: "Avg Order", value: "$62.35", color: "yellow" },
|
|
329
|
-
{ label: "Refunds", value: "$126", color: "red" },
|
|
330
|
-
{ label: "New Buyers", value: "24", color: "cyan" },
|
|
331
|
-
],
|
|
332
|
-
},
|
|
333
|
-
});
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
#### End
|
|
337
|
-
|
|
338
|
-
```ts
|
|
339
|
-
await activitysmith.liveActivities.end({
|
|
340
|
-
activity_id: activityId,
|
|
341
|
-
content_state: {
|
|
342
|
-
title: "Sales",
|
|
343
|
-
subtitle: "last hour",
|
|
344
|
-
type: "stats",
|
|
345
|
-
metrics: [
|
|
346
|
-
{ label: "Revenue", value: "$3460", color: "blue" },
|
|
347
|
-
{ label: "Orders", value: "58", color: "green" },
|
|
348
|
-
{ label: "Conversion", value: "5.4%", color: "magenta" },
|
|
349
|
-
{ label: "Avg Order", value: "$59.66", color: "yellow" },
|
|
350
|
-
{ label: "Refunds", value: "$92", color: "red" },
|
|
351
|
-
{ label: "New Buyers", value: "31", color: "cyan" },
|
|
352
|
-
],
|
|
353
|
-
auto_dismiss_minutes: 2,
|
|
354
|
-
},
|
|
355
|
-
});
|
|
356
|
-
```
|
|
357
|
-
|
|
358
|
-
### Metrics Type
|
|
359
|
-
|
|
360
|
-
Use `metrics` when you want to keep a small set of live stats visible, such as
|
|
361
|
-
server health, queue pressure, or database load.
|
|
362
|
-
|
|
363
|
-
#### Start
|
|
364
|
-
|
|
365
|
-
<p align="center">
|
|
366
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-start.png" alt="Metrics start example" width="680" />
|
|
367
|
-
</p>
|
|
368
|
-
|
|
369
|
-
```ts
|
|
370
|
-
const start = await activitysmith.liveActivities.start({
|
|
371
|
-
content_state: {
|
|
372
|
-
title: "Server Health",
|
|
373
|
-
subtitle: "prod-web-1",
|
|
374
|
-
type: "metrics",
|
|
375
|
-
metrics: [
|
|
376
|
-
{ label: "CPU", value: 9, unit: "%" },
|
|
377
|
-
{ label: "MEM", value: 45, unit: "%" },
|
|
378
|
-
],
|
|
379
|
-
},
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
const activityId = start.activity_id;
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
#### Update
|
|
386
|
-
|
|
387
|
-
<p align="center">
|
|
388
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-update.png" alt="Metrics update example" width="680" />
|
|
389
|
-
</p>
|
|
390
|
-
|
|
391
|
-
```ts
|
|
392
|
-
await activitysmith.liveActivities.update({
|
|
393
|
-
activity_id: activityId,
|
|
394
|
-
content_state: {
|
|
395
|
-
title: "Server Health",
|
|
396
|
-
subtitle: "prod-web-1",
|
|
397
|
-
type: "metrics",
|
|
398
|
-
metrics: [
|
|
399
|
-
{ label: "CPU", value: 76, unit: "%" },
|
|
400
|
-
{ label: "MEM", value: 52, unit: "%" },
|
|
401
|
-
],
|
|
402
|
-
},
|
|
403
|
-
});
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
#### End
|
|
407
|
-
|
|
408
|
-
<p align="center">
|
|
409
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-end.png" alt="Metrics end example" width="680" />
|
|
410
|
-
</p>
|
|
411
|
-
|
|
412
|
-
```ts
|
|
413
|
-
await activitysmith.liveActivities.end({
|
|
414
|
-
activity_id: activityId,
|
|
415
|
-
content_state: {
|
|
416
|
-
title: "Server Health",
|
|
417
|
-
subtitle: "prod-web-1",
|
|
418
|
-
type: "metrics",
|
|
419
|
-
metrics: [
|
|
420
|
-
{ label: "CPU", value: 7, unit: "%" },
|
|
421
|
-
{ label: "MEM", value: 38, unit: "%" },
|
|
422
|
-
],
|
|
423
|
-
auto_dismiss_minutes: 2,
|
|
424
|
-
},
|
|
425
|
-
});
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
### Segmented Progress Type
|
|
429
|
-
|
|
430
|
-
Use `segmented_progress` for jobs and workflows that move through clear steps or
|
|
431
|
-
phases. It fits jobs like backups, deployments, ETL pipelines, and checklists.
|
|
432
|
-
`number_of_steps` is dynamic, so you can increase or decrease it later if the
|
|
433
|
-
workflow changes.
|
|
434
|
-
|
|
435
|
-
#### Start
|
|
436
|
-
|
|
437
|
-
<p align="center">
|
|
438
|
-
<img src="https://cdn.activitysmith.com/features/start-live-activity.png" alt="Segmented progress start example" width="680" />
|
|
439
|
-
</p>
|
|
440
|
-
|
|
441
|
-
```ts
|
|
442
|
-
const start = await activitysmith.liveActivities.start({
|
|
443
|
-
content_state: {
|
|
444
|
-
title: "Nightly database backup",
|
|
445
|
-
subtitle: "create snapshot",
|
|
446
|
-
number_of_steps: 3,
|
|
447
|
-
current_step: 1,
|
|
448
|
-
type: "segmented_progress",
|
|
449
|
-
color: "yellow",
|
|
450
|
-
},
|
|
451
|
-
});
|
|
452
|
-
|
|
453
|
-
const activityId = start.activity_id;
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
#### Update
|
|
457
|
-
|
|
458
|
-
<p align="center">
|
|
459
|
-
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented progress update example" width="680" />
|
|
460
|
-
</p>
|
|
461
|
-
|
|
462
|
-
```ts
|
|
463
|
-
await activitysmith.liveActivities.update({
|
|
464
|
-
activity_id: activityId,
|
|
465
|
-
content_state: {
|
|
466
|
-
title: "Nightly database backup",
|
|
467
|
-
subtitle: "upload archive",
|
|
468
|
-
number_of_steps: 3,
|
|
469
|
-
current_step: 2,
|
|
470
|
-
},
|
|
471
|
-
});
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
#### End
|
|
475
|
-
|
|
476
|
-
<p align="center">
|
|
477
|
-
<img src="https://cdn.activitysmith.com/features/end-live-activity.png" alt="Segmented progress end example" width="680" />
|
|
478
|
-
</p>
|
|
479
|
-
|
|
480
|
-
```ts
|
|
481
|
-
await activitysmith.liveActivities.end({
|
|
482
|
-
activity_id: activityId,
|
|
483
|
-
content_state: {
|
|
484
|
-
title: "Nightly database backup",
|
|
485
|
-
subtitle: "verify restore",
|
|
486
|
-
number_of_steps: 3,
|
|
487
|
-
current_step: 3,
|
|
488
233
|
auto_dismiss_minutes: 2,
|
|
489
234
|
},
|
|
490
235
|
});
|
|
491
236
|
```
|
|
492
237
|
|
|
493
|
-
###
|
|
494
|
-
|
|
495
|
-
Use `progress` when the state is naturally continuous. It fits charging,
|
|
496
|
-
downloads, sync jobs, uploads, timers, and any flow where a percentage or
|
|
497
|
-
numeric range is the clearest signal.
|
|
498
|
-
|
|
499
|
-
#### Start
|
|
500
|
-
|
|
501
|
-
<p align="center">
|
|
502
|
-
<img src="https://cdn.activitysmith.com/features/progress-live-activity-start.png" alt="Progress start example" width="680" />
|
|
503
|
-
</p>
|
|
504
|
-
|
|
505
|
-
```ts
|
|
506
|
-
const start = await activitysmith.liveActivities.start({
|
|
507
|
-
content_state: {
|
|
508
|
-
title: "EV Charging",
|
|
509
|
-
subtitle: "Added 30 mi range",
|
|
510
|
-
type: "progress",
|
|
511
|
-
percentage: 15,
|
|
512
|
-
color: "lime",
|
|
513
|
-
},
|
|
514
|
-
});
|
|
515
|
-
|
|
516
|
-
const activityId = start.activity_id;
|
|
517
|
-
```
|
|
518
|
-
|
|
519
|
-
#### Update
|
|
520
|
-
|
|
521
|
-
<p align="center">
|
|
522
|
-
<img src="https://cdn.activitysmith.com/features/progress-live-activity-update.png" alt="Progress update example" width="680" />
|
|
523
|
-
</p>
|
|
524
|
-
|
|
525
|
-
```ts
|
|
526
|
-
await activitysmith.liveActivities.update({
|
|
527
|
-
activity_id: activityId,
|
|
528
|
-
content_state: {
|
|
529
|
-
title: "EV Charging",
|
|
530
|
-
subtitle: "Added 120 mi range",
|
|
531
|
-
percentage: 60,
|
|
532
|
-
},
|
|
533
|
-
});
|
|
534
|
-
```
|
|
238
|
+
### Live Activity Action
|
|
535
239
|
|
|
536
|
-
|
|
240
|
+
Live Activities can include one optional action button. Use it to open a URL from the Live Activity or trigger a backend webhook.
|
|
537
241
|
|
|
538
242
|
<p align="center">
|
|
539
|
-
<img src="https://cdn.activitysmith.com/features/
|
|
243
|
+
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action button" width="680" />
|
|
540
244
|
</p>
|
|
541
245
|
|
|
542
|
-
```ts
|
|
543
|
-
await activitysmith.liveActivities.end({
|
|
544
|
-
activity_id: activityId,
|
|
545
|
-
content_state: {
|
|
546
|
-
title: "EV Charging",
|
|
547
|
-
subtitle: "Added 200 mi range",
|
|
548
|
-
percentage: 100,
|
|
549
|
-
auto_dismiss_minutes: 2,
|
|
550
|
-
},
|
|
551
|
-
});
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
### Live Activity Action
|
|
555
|
-
|
|
556
|
-
Just like Actionable Push Notifications, Live Activities can have a button that opens provided URL in a browser or triggers a webhook. Webhooks are executed by the ActivitySmith backend.
|
|
557
|
-
|
|
558
246
|
#### Open URL action
|
|
559
247
|
|
|
560
|
-
<p align="center">
|
|
561
|
-
<img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity with action" width="680" />
|
|
562
|
-
</p>
|
|
563
|
-
|
|
564
248
|
```ts
|
|
565
|
-
|
|
249
|
+
await activitysmith.liveActivities.stream("prod-web-1", {
|
|
566
250
|
content_state: {
|
|
567
251
|
title: "Server Health",
|
|
568
252
|
subtitle: "prod-web-1",
|
|
@@ -578,22 +262,16 @@ const start = await activitysmith.liveActivities.start({
|
|
|
578
262
|
url: "https://ops.example.com/servers/prod-web-1",
|
|
579
263
|
},
|
|
580
264
|
});
|
|
581
|
-
|
|
582
|
-
const activityId = start.activity_id;
|
|
583
265
|
```
|
|
584
266
|
|
|
585
267
|
#### Webhook action
|
|
586
268
|
|
|
587
|
-
<p align="center">
|
|
588
|
-
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action" width="680" />
|
|
589
|
-
</p>
|
|
590
|
-
|
|
591
269
|
```ts
|
|
592
|
-
await activitysmith.liveActivities.
|
|
593
|
-
activity_id: activityId,
|
|
270
|
+
await activitysmith.liveActivities.stream("search-reindex", {
|
|
594
271
|
content_state: {
|
|
595
272
|
title: "Reindexing product search",
|
|
596
273
|
subtitle: "Shard 7 of 12",
|
|
274
|
+
type: "segmented_progress",
|
|
597
275
|
number_of_steps: 12,
|
|
598
276
|
current_step: 7,
|
|
599
277
|
},
|
|
@@ -33,13 +33,13 @@ export interface UpdateLiveActivityRequest {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
35
35
|
/**
|
|
36
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
37
|
-
* End a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
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
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
42
|
-
* End a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
42
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
43
43
|
*/
|
|
44
44
|
endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityEndResponse>;
|
|
45
45
|
/**
|
|
@@ -53,33 +53,33 @@ export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
53
53
|
*/
|
|
54
54
|
endLiveActivityStream(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStreamDeleteResponse>;
|
|
55
55
|
/**
|
|
56
|
-
* Use
|
|
57
|
-
*
|
|
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.
|
|
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
|
|
62
|
-
*
|
|
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.
|
|
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
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
67
|
-
* Start a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
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
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
72
|
-
* Start a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
72
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
73
73
|
*/
|
|
74
74
|
startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse>;
|
|
75
75
|
/**
|
|
76
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
77
|
-
* Update a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
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
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
82
|
-
* Update a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
82
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
83
83
|
*/
|
|
84
84
|
updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityUpdateResponse>;
|
|
85
85
|
}
|
|
@@ -20,8 +20,8 @@ const runtime = require("../runtime");
|
|
|
20
20
|
*/
|
|
21
21
|
class LiveActivitiesApi extends runtime.BaseAPI {
|
|
22
22
|
/**
|
|
23
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
24
|
-
* End a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
24
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
25
25
|
*/
|
|
26
26
|
async endLiveActivityRaw(requestParameters, initOverrides) {
|
|
27
27
|
if (requestParameters['liveActivityEndRequest'] == null) {
|
|
@@ -47,8 +47,8 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
47
47
|
return new runtime.JSONApiResponse(response);
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
51
|
-
* End a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
51
|
+
* End a Live Activity (legacy manual lifecycle)
|
|
52
52
|
*/
|
|
53
53
|
async endLiveActivity(requestParameters, initOverrides) {
|
|
54
54
|
const response = await this.endLiveActivityRaw(requestParameters, initOverrides);
|
|
@@ -90,8 +90,8 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
90
90
|
return await response.value();
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Use
|
|
94
|
-
*
|
|
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.
|
|
94
|
+
* Start a new Live Activity or update an existing one
|
|
95
95
|
*/
|
|
96
96
|
async reconcileLiveActivityStreamRaw(requestParameters, initOverrides) {
|
|
97
97
|
if (requestParameters['streamKey'] == null) {
|
|
@@ -120,16 +120,16 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
120
120
|
return new runtime.JSONApiResponse(response);
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
|
-
* Use
|
|
124
|
-
*
|
|
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.
|
|
124
|
+
* Start a new Live Activity or update an existing one
|
|
125
125
|
*/
|
|
126
126
|
async reconcileLiveActivityStream(requestParameters, initOverrides) {
|
|
127
127
|
const response = await this.reconcileLiveActivityStreamRaw(requestParameters, initOverrides);
|
|
128
128
|
return await response.value();
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
132
|
-
* Start a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
132
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
133
133
|
*/
|
|
134
134
|
async startLiveActivityRaw(requestParameters, initOverrides) {
|
|
135
135
|
if (requestParameters['liveActivityStartRequest'] == null) {
|
|
@@ -155,16 +155,16 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
155
155
|
return new runtime.JSONApiResponse(response);
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
159
|
-
* Start a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
159
|
+
* Start a Live Activity (legacy manual lifecycle)
|
|
160
160
|
*/
|
|
161
161
|
async startLiveActivity(requestParameters, initOverrides) {
|
|
162
162
|
const response = await this.startLiveActivityRaw(requestParameters, initOverrides);
|
|
163
163
|
return await response.value();
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
167
|
-
* Update a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
167
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
168
168
|
*/
|
|
169
169
|
async updateLiveActivityRaw(requestParameters, initOverrides) {
|
|
170
170
|
if (requestParameters['liveActivityUpdateRequest'] == null) {
|
|
@@ -190,8 +190,8 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
190
190
|
return new runtime.JSONApiResponse(response);
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
194
|
-
* Update a Live Activity
|
|
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, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
194
|
+
* Update a Live Activity (legacy manual lifecycle)
|
|
195
195
|
*/
|
|
196
196
|
async updateLiveActivity(requestParameters, initOverrides) {
|
|
197
197
|
const response = await this.updateLiveActivityRaw(requestParameters, initOverrides);
|