activitysmith 1.6.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 CHANGED
@@ -98,7 +98,7 @@ What will work:
98
98
  <img src="https://cdn.activitysmith.com/features/actionable-push-notifications-2.png" alt="Actionable push notification example" width="680" />
99
99
  </p>
100
100
 
101
- Actionable push notifications can open a URL on tap or trigger actions when someone long-presses the notification.
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.
102
102
  Webhooks are executed by the ActivitySmith backend.
103
103
 
104
104
  ```ts
@@ -112,6 +112,11 @@ await activitysmith.notifications.send({
112
112
  type: "open_url",
113
113
  url: "https://crm.example.com/customers/cus_9f3a1d",
114
114
  },
115
+ {
116
+ title: "Chat with Jarvis",
117
+ type: "open_url",
118
+ url: "shortcuts://run-shortcut?name=Jarvis",
119
+ },
115
120
  {
116
121
  title: "Start Onboarding Workflow",
117
122
  type: "webhook",
@@ -128,13 +133,14 @@ await activitysmith.notifications.send({
128
133
 
129
134
  ## Live Activities
130
135
 
131
- There are five types of Live Activities:
136
+ There are six types of Live Activities:
132
137
 
133
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
134
139
  - `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
135
140
  - `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
136
141
  - `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
137
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
138
144
 
139
145
  ### Start & Update Live Activity
140
146
 
@@ -237,6 +243,28 @@ await activitysmith.liveActivities.stream("customer-ops", {
237
243
  });
238
244
  ```
239
245
 
246
+ #### Timer
247
+
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>
251
+
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`.
267
+
240
268
  ### End Live Activity
241
269
 
242
270
  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.
@@ -258,8 +286,11 @@ await activitysmith.liveActivities.endStream("prod-web-1", {
258
286
 
259
287
  ### Live Activity Action
260
288
 
261
- Live Activities can include one optional action button. Use it to open a URL from the Live Activity or trigger a backend webhook.
262
- For Alert Live Activities, set `content_state.color` to tint the action button. `icon.color` and `badge.color` only affect the icon and badge.
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.
263
294
 
264
295
  <p align="center">
265
296
  <img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action button" width="680" />
@@ -279,13 +310,32 @@ await activitysmith.liveActivities.stream("prod-web-1", {
279
310
  ],
280
311
  },
281
312
  action: {
282
- title: "Open Dashboard",
313
+ title: "Dashboard",
283
314
  type: "open_url",
284
315
  url: "https://ops.example.com/servers/prod-web-1",
285
316
  },
286
317
  });
287
318
  ```
288
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
+
289
339
  #### Webhook action
290
340
 
291
341
  ```ts
@@ -316,7 +366,7 @@ Add more context to Live Activities with icons and badges.
316
366
 
317
367
  #### Icon
318
368
 
319
- Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, and `alert`.
369
+ Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`.
320
370
 
321
371
  <p align="center">
322
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" />
@@ -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 alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
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 alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
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 alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
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 alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
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 alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
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 alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
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 alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
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 alert activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
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 alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
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 alert activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
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 alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
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 alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
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. 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.
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
  */
@@ -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,7 +186,7 @@ export interface ContentStateEnd {
168
186
  */
169
187
  message?: string;
170
188
  /**
171
- * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
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
  */
@@ -186,7 +204,7 @@ export interface ContentStateEnd {
186
204
  */
187
205
  type?: ContentStateEndTypeEnum;
188
206
  /**
189
- * Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
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. 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.
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
  */
@@ -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,7 +368,7 @@ export interface ContentStateStart {
331
368
  */
332
369
  message?: string;
333
370
  /**
334
- * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
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
  */
@@ -349,7 +386,7 @@ export interface ContentStateStart {
349
386
  */
350
387
  type: ContentStateStartTypeEnum;
351
388
  /**
352
- * Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
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. 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.
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
  */
@@ -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,7 +544,7 @@ export interface ContentStateUpdate {
488
544
  */
489
545
  message?: string;
490
546
  /**
491
- * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
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
  */
@@ -506,7 +562,7 @@ export interface ContentStateUpdate {
506
562
  */
507
563
  type?: ContentStateUpdateTypeEnum;
508
564
  /**
509
- * Optional. Accent color for progress, segmented_progress, and metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
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
- * Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.
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
  */
@@ -1280,7 +1337,7 @@ export interface PushNotificationAction {
1280
1337
  */
1281
1338
  type: PushNotificationActionType;
1282
1339
  /**
1283
- * Action URL. For open_url, use an HTTPS or shortcuts:// URL. For webhook, use an HTTPS URL called by the ActivitySmith backend.
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 or shortcuts:// 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 alert types.
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
  */
@@ -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 metrics Live Activities. For Alert Live Activities, this tints the action button when action is included.
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,7 +1613,7 @@ export interface StreamContentState {
1538
1613
  */
1539
1614
  message?: string;
1540
1615
  /**
1541
- * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, and stats.
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
  */
@@ -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.6.0";
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Official ActivitySmith Node.js SDK",
5
5
  "keywords": [
6
6
  "activitysmith",