activitysmith 1.3.1 → 1.4.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 +29 -1
- package/dist/generated/apis/LiveActivitiesApi.d.ts +6 -6
- package/dist/generated/apis/LiveActivitiesApi.js +6 -6
- package/dist/generated/models/index.d.ts +154 -8
- package/dist/generated/models/index.js +51 -18
- package/dist/src/ActivitySmith.d.ts +55 -5
- package/dist/src/ActivitySmith.js +24 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,12 +126,13 @@ await activitysmith.notifications.send({
|
|
|
126
126
|
|
|
127
127
|
## Live Activities
|
|
128
128
|
|
|
129
|
-
There are
|
|
129
|
+
There are five types of Live Activities:
|
|
130
130
|
|
|
131
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
132
|
- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
|
|
133
133
|
- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
|
|
134
134
|
- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
|
|
135
|
+
- `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states
|
|
135
136
|
|
|
136
137
|
### Start & Update Live Activity
|
|
137
138
|
|
|
@@ -216,6 +217,32 @@ await activitysmith.liveActivities.stream("search-reindex", {
|
|
|
216
217
|
});
|
|
217
218
|
```
|
|
218
219
|
|
|
220
|
+
#### Alert
|
|
221
|
+
|
|
222
|
+
<p align="center">
|
|
223
|
+
<img src="https://cdn.activitysmith.com/features/alert-live-activity.png" alt="Alert Live Activity stream example" width="680" />
|
|
224
|
+
</p>
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
await activitysmith.liveActivities.stream("customer-ops", {
|
|
228
|
+
content_state: ActivitySmith.contentState({
|
|
229
|
+
title: "Reactivation",
|
|
230
|
+
message: "Lumen came back after 2 weeks",
|
|
231
|
+
type: "alert",
|
|
232
|
+
icon: ActivitySmith.alertIcon("cloud.sun", { color: "yellow" }),
|
|
233
|
+
badge: ActivitySmith.alertBadge("Customer", { color: "magenta" }),
|
|
234
|
+
}),
|
|
235
|
+
});
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The `icon.symbol` value is an Apple SF Symbol name. Browse the catalog with one of these tools:
|
|
239
|
+
|
|
240
|
+
- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use
|
|
241
|
+
- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app
|
|
242
|
+
- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography
|
|
243
|
+
|
|
244
|
+
`icon` and `badge` are optional. If you omit either one, that element is not shown in the Live Activity.
|
|
245
|
+
|
|
219
246
|
### End Live Activity
|
|
220
247
|
|
|
221
248
|
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.
|
|
@@ -238,6 +265,7 @@ await activitysmith.liveActivities.endStream("prod-web-1", {
|
|
|
238
265
|
### Live Activity Action
|
|
239
266
|
|
|
240
267
|
Live Activities can include one optional action button. Use it to open a URL from the Live Activity or trigger a backend webhook.
|
|
268
|
+
For Alert Live Activities, set `content_state.color` to tint the action button. `icon.color` and `badge.color` only affect the icon and badge.
|
|
241
269
|
|
|
242
270
|
<p align="center">
|
|
243
271
|
<img src="https://cdn.activitysmith.com/features/live-activity-with-action.png?v=20260319-1" alt="Live Activity with action button" 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, 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, and alert 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, 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, and alert 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>;
|
|
@@ -63,22 +63,22 @@ export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
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, 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, and alert 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, 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, and alert 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, 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
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, 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
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, 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, and alert 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, 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, and alert 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) {
|
|
@@ -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, 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, and alert 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, 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, and alert 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, 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
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, 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, and alert activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
194
194
|
* Update a Live Activity (legacy manual lifecycle)
|
|
195
195
|
*/
|
|
196
196
|
async updateLiveActivity(requestParameters, initOverrides) {
|
|
@@ -43,6 +43,7 @@ export declare const ActivityMetricColorEnum: {
|
|
|
43
43
|
readonly Red: "red";
|
|
44
44
|
readonly Orange: "orange";
|
|
45
45
|
readonly Yellow: "yellow";
|
|
46
|
+
readonly Gray: "gray";
|
|
46
47
|
};
|
|
47
48
|
export type ActivityMetricColorEnum = typeof ActivityMetricColorEnum[keyof typeof ActivityMetricColorEnum];
|
|
48
49
|
/**
|
|
@@ -106,7 +107,7 @@ export interface ChannelTarget {
|
|
|
106
107
|
channels: Array<string>;
|
|
107
108
|
}
|
|
108
109
|
/**
|
|
109
|
-
* 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. 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, with optional icon and badge. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
|
|
110
111
|
* @export
|
|
111
112
|
* @interface ContentStateEnd
|
|
112
113
|
*/
|
|
@@ -160,6 +161,24 @@ export interface ContentStateEnd {
|
|
|
160
161
|
* @memberof ContentStateEnd
|
|
161
162
|
*/
|
|
162
163
|
metrics?: Array<ActivityMetric>;
|
|
164
|
+
/**
|
|
165
|
+
* Alert message. Use for type=alert.
|
|
166
|
+
* @type {string}
|
|
167
|
+
* @memberof ContentStateEnd
|
|
168
|
+
*/
|
|
169
|
+
message?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Optional SF Symbol icon for type=alert.
|
|
172
|
+
* @type {LiveActivityAlertIcon}
|
|
173
|
+
* @memberof ContentStateEnd
|
|
174
|
+
*/
|
|
175
|
+
icon?: LiveActivityAlertIcon;
|
|
176
|
+
/**
|
|
177
|
+
* Optional badge for type=alert.
|
|
178
|
+
* @type {LiveActivityAlertBadge}
|
|
179
|
+
* @memberof ContentStateEnd
|
|
180
|
+
*/
|
|
181
|
+
badge?: LiveActivityAlertBadge;
|
|
163
182
|
/**
|
|
164
183
|
* Optional. When omitted, the API uses the existing Live Activity type.
|
|
165
184
|
* @type {string}
|
|
@@ -167,7 +186,7 @@ export interface ContentStateEnd {
|
|
|
167
186
|
*/
|
|
168
187
|
type?: ContentStateEndTypeEnum;
|
|
169
188
|
/**
|
|
170
|
-
* Optional. Accent color for
|
|
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.
|
|
171
190
|
* @type {string}
|
|
172
191
|
* @memberof ContentStateEnd
|
|
173
192
|
*/
|
|
@@ -199,6 +218,7 @@ export declare const ContentStateEndTypeEnum: {
|
|
|
199
218
|
readonly Progress: "progress";
|
|
200
219
|
readonly Metrics: "metrics";
|
|
201
220
|
readonly Stats: "stats";
|
|
221
|
+
readonly Alert: "alert";
|
|
202
222
|
};
|
|
203
223
|
export type ContentStateEndTypeEnum = typeof ContentStateEndTypeEnum[keyof typeof ContentStateEndTypeEnum];
|
|
204
224
|
/**
|
|
@@ -214,6 +234,7 @@ export declare const ContentStateEndColorEnum: {
|
|
|
214
234
|
readonly Red: "red";
|
|
215
235
|
readonly Orange: "orange";
|
|
216
236
|
readonly Yellow: "yellow";
|
|
237
|
+
readonly Gray: "gray";
|
|
217
238
|
};
|
|
218
239
|
export type ContentStateEndColorEnum = typeof ContentStateEndColorEnum[keyof typeof ContentStateEndColorEnum];
|
|
219
240
|
/**
|
|
@@ -229,6 +250,7 @@ export declare const ContentStateEndStepColorEnum: {
|
|
|
229
250
|
readonly Red: "red";
|
|
230
251
|
readonly Orange: "orange";
|
|
231
252
|
readonly Yellow: "yellow";
|
|
253
|
+
readonly Gray: "gray";
|
|
232
254
|
};
|
|
233
255
|
export type ContentStateEndStepColorEnum = typeof ContentStateEndStepColorEnum[keyof typeof ContentStateEndStepColorEnum];
|
|
234
256
|
/**
|
|
@@ -244,10 +266,11 @@ export declare const ContentStateEndStepColorsEnum: {
|
|
|
244
266
|
readonly Red: "red";
|
|
245
267
|
readonly Orange: "orange";
|
|
246
268
|
readonly Yellow: "yellow";
|
|
269
|
+
readonly Gray: "gray";
|
|
247
270
|
};
|
|
248
271
|
export type ContentStateEndStepColorsEnum = typeof ContentStateEndStepColorsEnum[keyof typeof ContentStateEndStepColorsEnum];
|
|
249
272
|
/**
|
|
250
|
-
* 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 segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
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, with optional icon and badge. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
251
274
|
* @export
|
|
252
275
|
* @interface ContentStateStart
|
|
253
276
|
*/
|
|
@@ -301,6 +324,24 @@ export interface ContentStateStart {
|
|
|
301
324
|
* @memberof ContentStateStart
|
|
302
325
|
*/
|
|
303
326
|
metrics?: Array<ActivityMetric>;
|
|
327
|
+
/**
|
|
328
|
+
* Required for type=alert.
|
|
329
|
+
* @type {string}
|
|
330
|
+
* @memberof ContentStateStart
|
|
331
|
+
*/
|
|
332
|
+
message?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Optional SF Symbol icon for type=alert.
|
|
335
|
+
* @type {LiveActivityAlertIcon}
|
|
336
|
+
* @memberof ContentStateStart
|
|
337
|
+
*/
|
|
338
|
+
icon?: LiveActivityAlertIcon;
|
|
339
|
+
/**
|
|
340
|
+
* Optional badge for type=alert.
|
|
341
|
+
* @type {LiveActivityAlertBadge}
|
|
342
|
+
* @memberof ContentStateStart
|
|
343
|
+
*/
|
|
344
|
+
badge?: LiveActivityAlertBadge;
|
|
304
345
|
/**
|
|
305
346
|
*
|
|
306
347
|
* @type {string}
|
|
@@ -308,7 +349,7 @@ export interface ContentStateStart {
|
|
|
308
349
|
*/
|
|
309
350
|
type: ContentStateStartTypeEnum;
|
|
310
351
|
/**
|
|
311
|
-
* Optional. Accent color for
|
|
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.
|
|
312
353
|
* @type {string}
|
|
313
354
|
* @memberof ContentStateStart
|
|
314
355
|
*/
|
|
@@ -334,6 +375,7 @@ export declare const ContentStateStartTypeEnum: {
|
|
|
334
375
|
readonly Progress: "progress";
|
|
335
376
|
readonly Metrics: "metrics";
|
|
336
377
|
readonly Stats: "stats";
|
|
378
|
+
readonly Alert: "alert";
|
|
337
379
|
};
|
|
338
380
|
export type ContentStateStartTypeEnum = typeof ContentStateStartTypeEnum[keyof typeof ContentStateStartTypeEnum];
|
|
339
381
|
/**
|
|
@@ -349,6 +391,7 @@ export declare const ContentStateStartColorEnum: {
|
|
|
349
391
|
readonly Red: "red";
|
|
350
392
|
readonly Orange: "orange";
|
|
351
393
|
readonly Yellow: "yellow";
|
|
394
|
+
readonly Gray: "gray";
|
|
352
395
|
};
|
|
353
396
|
export type ContentStateStartColorEnum = typeof ContentStateStartColorEnum[keyof typeof ContentStateStartColorEnum];
|
|
354
397
|
/**
|
|
@@ -364,6 +407,7 @@ export declare const ContentStateStartStepColorEnum: {
|
|
|
364
407
|
readonly Red: "red";
|
|
365
408
|
readonly Orange: "orange";
|
|
366
409
|
readonly Yellow: "yellow";
|
|
410
|
+
readonly Gray: "gray";
|
|
367
411
|
};
|
|
368
412
|
export type ContentStateStartStepColorEnum = typeof ContentStateStartStepColorEnum[keyof typeof ContentStateStartStepColorEnum];
|
|
369
413
|
/**
|
|
@@ -379,10 +423,11 @@ export declare const ContentStateStartStepColorsEnum: {
|
|
|
379
423
|
readonly Red: "red";
|
|
380
424
|
readonly Orange: "orange";
|
|
381
425
|
readonly Yellow: "yellow";
|
|
426
|
+
readonly Gray: "gray";
|
|
382
427
|
};
|
|
383
428
|
export type ContentStateStartStepColorsEnum = typeof ContentStateStartStepColorsEnum[keyof typeof ContentStateStartStepColorsEnum];
|
|
384
429
|
/**
|
|
385
|
-
* 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. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
|
|
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, with optional icon and badge. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
|
|
386
431
|
* @export
|
|
387
432
|
* @interface ContentStateUpdate
|
|
388
433
|
*/
|
|
@@ -436,6 +481,24 @@ export interface ContentStateUpdate {
|
|
|
436
481
|
* @memberof ContentStateUpdate
|
|
437
482
|
*/
|
|
438
483
|
metrics?: Array<ActivityMetric>;
|
|
484
|
+
/**
|
|
485
|
+
* Alert message. Use for type=alert.
|
|
486
|
+
* @type {string}
|
|
487
|
+
* @memberof ContentStateUpdate
|
|
488
|
+
*/
|
|
489
|
+
message?: string;
|
|
490
|
+
/**
|
|
491
|
+
* Optional SF Symbol icon for type=alert.
|
|
492
|
+
* @type {LiveActivityAlertIcon}
|
|
493
|
+
* @memberof ContentStateUpdate
|
|
494
|
+
*/
|
|
495
|
+
icon?: LiveActivityAlertIcon;
|
|
496
|
+
/**
|
|
497
|
+
* Optional badge for type=alert.
|
|
498
|
+
* @type {LiveActivityAlertBadge}
|
|
499
|
+
* @memberof ContentStateUpdate
|
|
500
|
+
*/
|
|
501
|
+
badge?: LiveActivityAlertBadge;
|
|
439
502
|
/**
|
|
440
503
|
* Optional. When omitted, the API uses the existing Live Activity type.
|
|
441
504
|
* @type {string}
|
|
@@ -443,7 +506,7 @@ export interface ContentStateUpdate {
|
|
|
443
506
|
*/
|
|
444
507
|
type?: ContentStateUpdateTypeEnum;
|
|
445
508
|
/**
|
|
446
|
-
* Optional. Accent color for
|
|
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.
|
|
447
510
|
* @type {string}
|
|
448
511
|
* @memberof ContentStateUpdate
|
|
449
512
|
*/
|
|
@@ -469,6 +532,7 @@ export declare const ContentStateUpdateTypeEnum: {
|
|
|
469
532
|
readonly Progress: "progress";
|
|
470
533
|
readonly Metrics: "metrics";
|
|
471
534
|
readonly Stats: "stats";
|
|
535
|
+
readonly Alert: "alert";
|
|
472
536
|
};
|
|
473
537
|
export type ContentStateUpdateTypeEnum = typeof ContentStateUpdateTypeEnum[keyof typeof ContentStateUpdateTypeEnum];
|
|
474
538
|
/**
|
|
@@ -484,6 +548,7 @@ export declare const ContentStateUpdateColorEnum: {
|
|
|
484
548
|
readonly Red: "red";
|
|
485
549
|
readonly Orange: "orange";
|
|
486
550
|
readonly Yellow: "yellow";
|
|
551
|
+
readonly Gray: "gray";
|
|
487
552
|
};
|
|
488
553
|
export type ContentStateUpdateColorEnum = typeof ContentStateUpdateColorEnum[keyof typeof ContentStateUpdateColorEnum];
|
|
489
554
|
/**
|
|
@@ -499,6 +564,7 @@ export declare const ContentStateUpdateStepColorEnum: {
|
|
|
499
564
|
readonly Red: "red";
|
|
500
565
|
readonly Orange: "orange";
|
|
501
566
|
readonly Yellow: "yellow";
|
|
567
|
+
readonly Gray: "gray";
|
|
502
568
|
};
|
|
503
569
|
export type ContentStateUpdateStepColorEnum = typeof ContentStateUpdateStepColorEnum[keyof typeof ContentStateUpdateStepColorEnum];
|
|
504
570
|
/**
|
|
@@ -514,6 +580,7 @@ export declare const ContentStateUpdateStepColorsEnum: {
|
|
|
514
580
|
readonly Red: "red";
|
|
515
581
|
readonly Orange: "orange";
|
|
516
582
|
readonly Yellow: "yellow";
|
|
583
|
+
readonly Gray: "gray";
|
|
517
584
|
};
|
|
518
585
|
export type ContentStateUpdateStepColorsEnum = typeof ContentStateUpdateStepColorsEnum[keyof typeof ContentStateUpdateStepColorsEnum];
|
|
519
586
|
/**
|
|
@@ -585,6 +652,63 @@ export declare const LiveActivityActionType: {
|
|
|
585
652
|
readonly Webhook: "webhook";
|
|
586
653
|
};
|
|
587
654
|
export type LiveActivityActionType = typeof LiveActivityActionType[keyof typeof LiveActivityActionType];
|
|
655
|
+
/**
|
|
656
|
+
* Optional badge for Alert Live Activities.
|
|
657
|
+
* @export
|
|
658
|
+
* @interface LiveActivityAlertBadge
|
|
659
|
+
*/
|
|
660
|
+
export interface LiveActivityAlertBadge {
|
|
661
|
+
[key: string]: any | any;
|
|
662
|
+
/**
|
|
663
|
+
*
|
|
664
|
+
* @type {string}
|
|
665
|
+
* @memberof LiveActivityAlertBadge
|
|
666
|
+
*/
|
|
667
|
+
title: string;
|
|
668
|
+
/**
|
|
669
|
+
* Optional badge color.
|
|
670
|
+
* @type {LiveActivityColor}
|
|
671
|
+
* @memberof LiveActivityAlertBadge
|
|
672
|
+
*/
|
|
673
|
+
color?: LiveActivityColor;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Optional SF Symbol icon for Alert Live Activities.
|
|
677
|
+
* @export
|
|
678
|
+
* @interface LiveActivityAlertIcon
|
|
679
|
+
*/
|
|
680
|
+
export interface LiveActivityAlertIcon {
|
|
681
|
+
[key: string]: any | any;
|
|
682
|
+
/**
|
|
683
|
+
* Apple SF Symbol name.
|
|
684
|
+
* @type {string}
|
|
685
|
+
* @memberof LiveActivityAlertIcon
|
|
686
|
+
*/
|
|
687
|
+
symbol: string;
|
|
688
|
+
/**
|
|
689
|
+
* Optional icon color.
|
|
690
|
+
* @type {LiveActivityColor}
|
|
691
|
+
* @memberof LiveActivityAlertIcon
|
|
692
|
+
*/
|
|
693
|
+
color?: LiveActivityColor;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
*
|
|
697
|
+
* @export
|
|
698
|
+
*/
|
|
699
|
+
export declare const LiveActivityColor: {
|
|
700
|
+
readonly Lime: "lime";
|
|
701
|
+
readonly Green: "green";
|
|
702
|
+
readonly Cyan: "cyan";
|
|
703
|
+
readonly Blue: "blue";
|
|
704
|
+
readonly Purple: "purple";
|
|
705
|
+
readonly Magenta: "magenta";
|
|
706
|
+
readonly Red: "red";
|
|
707
|
+
readonly Orange: "orange";
|
|
708
|
+
readonly Yellow: "yellow";
|
|
709
|
+
readonly Gray: "gray";
|
|
710
|
+
};
|
|
711
|
+
export type LiveActivityColor = typeof LiveActivityColor[keyof typeof LiveActivityColor];
|
|
588
712
|
/**
|
|
589
713
|
* End an existing Live Activity by activity_id.
|
|
590
714
|
* @export
|
|
@@ -1329,7 +1453,7 @@ export interface RateLimitError {
|
|
|
1329
1453
|
*/
|
|
1330
1454
|
export type SendPushNotification429Response = LiveActivityLimitError | RateLimitError;
|
|
1331
1455
|
/**
|
|
1332
|
-
* 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, and
|
|
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.
|
|
1333
1457
|
* @export
|
|
1334
1458
|
* @interface StreamContentState
|
|
1335
1459
|
*/
|
|
@@ -1384,7 +1508,7 @@ export interface StreamContentState {
|
|
|
1384
1508
|
*/
|
|
1385
1509
|
type?: StreamContentStateTypeEnum;
|
|
1386
1510
|
/**
|
|
1387
|
-
* Optional. Accent color for
|
|
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.
|
|
1388
1512
|
* @type {string}
|
|
1389
1513
|
* @memberof StreamContentState
|
|
1390
1514
|
*/
|
|
@@ -1407,6 +1531,24 @@ export interface StreamContentState {
|
|
|
1407
1531
|
* @memberof StreamContentState
|
|
1408
1532
|
*/
|
|
1409
1533
|
metrics?: Array<ActivityMetric>;
|
|
1534
|
+
/**
|
|
1535
|
+
* Required for type=alert.
|
|
1536
|
+
* @type {string}
|
|
1537
|
+
* @memberof StreamContentState
|
|
1538
|
+
*/
|
|
1539
|
+
message?: string;
|
|
1540
|
+
/**
|
|
1541
|
+
* Optional SF Symbol icon for type=alert.
|
|
1542
|
+
* @type {LiveActivityAlertIcon}
|
|
1543
|
+
* @memberof StreamContentState
|
|
1544
|
+
*/
|
|
1545
|
+
icon?: LiveActivityAlertIcon;
|
|
1546
|
+
/**
|
|
1547
|
+
* Optional badge for type=alert.
|
|
1548
|
+
* @type {LiveActivityAlertBadge}
|
|
1549
|
+
* @memberof StreamContentState
|
|
1550
|
+
*/
|
|
1551
|
+
badge?: LiveActivityAlertBadge;
|
|
1410
1552
|
/**
|
|
1411
1553
|
* Optional. Seconds before the ended Live Activity is dismissed.
|
|
1412
1554
|
* @type {number}
|
|
@@ -1428,6 +1570,7 @@ export declare const StreamContentStateTypeEnum: {
|
|
|
1428
1570
|
readonly Progress: "progress";
|
|
1429
1571
|
readonly Metrics: "metrics";
|
|
1430
1572
|
readonly Stats: "stats";
|
|
1573
|
+
readonly Alert: "alert";
|
|
1431
1574
|
};
|
|
1432
1575
|
export type StreamContentStateTypeEnum = typeof StreamContentStateTypeEnum[keyof typeof StreamContentStateTypeEnum];
|
|
1433
1576
|
/**
|
|
@@ -1443,6 +1586,7 @@ export declare const StreamContentStateColorEnum: {
|
|
|
1443
1586
|
readonly Red: "red";
|
|
1444
1587
|
readonly Orange: "orange";
|
|
1445
1588
|
readonly Yellow: "yellow";
|
|
1589
|
+
readonly Gray: "gray";
|
|
1446
1590
|
};
|
|
1447
1591
|
export type StreamContentStateColorEnum = typeof StreamContentStateColorEnum[keyof typeof StreamContentStateColorEnum];
|
|
1448
1592
|
/**
|
|
@@ -1458,6 +1602,7 @@ export declare const StreamContentStateStepColorEnum: {
|
|
|
1458
1602
|
readonly Red: "red";
|
|
1459
1603
|
readonly Orange: "orange";
|
|
1460
1604
|
readonly Yellow: "yellow";
|
|
1605
|
+
readonly Gray: "gray";
|
|
1461
1606
|
};
|
|
1462
1607
|
export type StreamContentStateStepColorEnum = typeof StreamContentStateStepColorEnum[keyof typeof StreamContentStateStepColorEnum];
|
|
1463
1608
|
/**
|
|
@@ -1473,5 +1618,6 @@ export declare const StreamContentStateStepColorsEnum: {
|
|
|
1473
1618
|
readonly Red: "red";
|
|
1474
1619
|
readonly Orange: "orange";
|
|
1475
1620
|
readonly Yellow: "yellow";
|
|
1621
|
+
readonly Gray: "gray";
|
|
1476
1622
|
};
|
|
1477
1623
|
export type StreamContentStateStepColorsEnum = typeof StreamContentStateStepColorsEnum[keyof typeof StreamContentStateStepColorsEnum];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StreamContentStateStepColorsEnum = exports.StreamContentStateStepColorEnum = exports.StreamContentStateColorEnum = exports.StreamContentStateTypeEnum = exports.PushNotificationWebhookMethod = exports.PushNotificationActionType = exports.LiveActivityWebhookMethod = exports.LiveActivityStreamPutResponseOperationEnum = exports.LiveActivityStreamDeleteResponseOperationEnum = exports.LiveActivityActionType = exports.ContentStateUpdateStepColorsEnum = exports.ContentStateUpdateStepColorEnum = exports.ContentStateUpdateColorEnum = exports.ContentStateUpdateTypeEnum = exports.ContentStateStartStepColorsEnum = exports.ContentStateStartStepColorEnum = exports.ContentStateStartColorEnum = exports.ContentStateStartTypeEnum = exports.ContentStateEndStepColorsEnum = exports.ContentStateEndStepColorEnum = exports.ContentStateEndColorEnum = exports.ContentStateEndTypeEnum = exports.ActivityMetricColorEnum = void 0;
|
|
3
|
+
exports.StreamContentStateStepColorsEnum = exports.StreamContentStateStepColorEnum = exports.StreamContentStateColorEnum = exports.StreamContentStateTypeEnum = exports.PushNotificationWebhookMethod = exports.PushNotificationActionType = exports.LiveActivityWebhookMethod = exports.LiveActivityStreamPutResponseOperationEnum = exports.LiveActivityStreamDeleteResponseOperationEnum = exports.LiveActivityColor = exports.LiveActivityActionType = exports.ContentStateUpdateStepColorsEnum = exports.ContentStateUpdateStepColorEnum = exports.ContentStateUpdateColorEnum = exports.ContentStateUpdateTypeEnum = exports.ContentStateStartStepColorsEnum = exports.ContentStateStartStepColorEnum = exports.ContentStateStartColorEnum = exports.ContentStateStartTypeEnum = exports.ContentStateEndStepColorsEnum = exports.ContentStateEndStepColorEnum = exports.ContentStateEndColorEnum = exports.ContentStateEndTypeEnum = exports.ActivityMetricColorEnum = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @export
|
|
6
6
|
*/
|
|
@@ -13,7 +13,8 @@ exports.ActivityMetricColorEnum = {
|
|
|
13
13
|
Magenta: 'magenta',
|
|
14
14
|
Red: 'red',
|
|
15
15
|
Orange: 'orange',
|
|
16
|
-
Yellow: 'yellow'
|
|
16
|
+
Yellow: 'yellow',
|
|
17
|
+
Gray: 'gray'
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
20
|
* @export
|
|
@@ -22,7 +23,8 @@ exports.ContentStateEndTypeEnum = {
|
|
|
22
23
|
SegmentedProgress: 'segmented_progress',
|
|
23
24
|
Progress: 'progress',
|
|
24
25
|
Metrics: 'metrics',
|
|
25
|
-
Stats: 'stats'
|
|
26
|
+
Stats: 'stats',
|
|
27
|
+
Alert: 'alert'
|
|
26
28
|
};
|
|
27
29
|
/**
|
|
28
30
|
* @export
|
|
@@ -36,7 +38,8 @@ exports.ContentStateEndColorEnum = {
|
|
|
36
38
|
Magenta: 'magenta',
|
|
37
39
|
Red: 'red',
|
|
38
40
|
Orange: 'orange',
|
|
39
|
-
Yellow: 'yellow'
|
|
41
|
+
Yellow: 'yellow',
|
|
42
|
+
Gray: 'gray'
|
|
40
43
|
};
|
|
41
44
|
/**
|
|
42
45
|
* @export
|
|
@@ -50,7 +53,8 @@ exports.ContentStateEndStepColorEnum = {
|
|
|
50
53
|
Magenta: 'magenta',
|
|
51
54
|
Red: 'red',
|
|
52
55
|
Orange: 'orange',
|
|
53
|
-
Yellow: 'yellow'
|
|
56
|
+
Yellow: 'yellow',
|
|
57
|
+
Gray: 'gray'
|
|
54
58
|
};
|
|
55
59
|
/**
|
|
56
60
|
* @export
|
|
@@ -64,7 +68,8 @@ exports.ContentStateEndStepColorsEnum = {
|
|
|
64
68
|
Magenta: 'magenta',
|
|
65
69
|
Red: 'red',
|
|
66
70
|
Orange: 'orange',
|
|
67
|
-
Yellow: 'yellow'
|
|
71
|
+
Yellow: 'yellow',
|
|
72
|
+
Gray: 'gray'
|
|
68
73
|
};
|
|
69
74
|
/**
|
|
70
75
|
* @export
|
|
@@ -73,7 +78,8 @@ exports.ContentStateStartTypeEnum = {
|
|
|
73
78
|
SegmentedProgress: 'segmented_progress',
|
|
74
79
|
Progress: 'progress',
|
|
75
80
|
Metrics: 'metrics',
|
|
76
|
-
Stats: 'stats'
|
|
81
|
+
Stats: 'stats',
|
|
82
|
+
Alert: 'alert'
|
|
77
83
|
};
|
|
78
84
|
/**
|
|
79
85
|
* @export
|
|
@@ -87,7 +93,8 @@ exports.ContentStateStartColorEnum = {
|
|
|
87
93
|
Magenta: 'magenta',
|
|
88
94
|
Red: 'red',
|
|
89
95
|
Orange: 'orange',
|
|
90
|
-
Yellow: 'yellow'
|
|
96
|
+
Yellow: 'yellow',
|
|
97
|
+
Gray: 'gray'
|
|
91
98
|
};
|
|
92
99
|
/**
|
|
93
100
|
* @export
|
|
@@ -101,7 +108,8 @@ exports.ContentStateStartStepColorEnum = {
|
|
|
101
108
|
Magenta: 'magenta',
|
|
102
109
|
Red: 'red',
|
|
103
110
|
Orange: 'orange',
|
|
104
|
-
Yellow: 'yellow'
|
|
111
|
+
Yellow: 'yellow',
|
|
112
|
+
Gray: 'gray'
|
|
105
113
|
};
|
|
106
114
|
/**
|
|
107
115
|
* @export
|
|
@@ -115,7 +123,8 @@ exports.ContentStateStartStepColorsEnum = {
|
|
|
115
123
|
Magenta: 'magenta',
|
|
116
124
|
Red: 'red',
|
|
117
125
|
Orange: 'orange',
|
|
118
|
-
Yellow: 'yellow'
|
|
126
|
+
Yellow: 'yellow',
|
|
127
|
+
Gray: 'gray'
|
|
119
128
|
};
|
|
120
129
|
/**
|
|
121
130
|
* @export
|
|
@@ -124,7 +133,8 @@ exports.ContentStateUpdateTypeEnum = {
|
|
|
124
133
|
SegmentedProgress: 'segmented_progress',
|
|
125
134
|
Progress: 'progress',
|
|
126
135
|
Metrics: 'metrics',
|
|
127
|
-
Stats: 'stats'
|
|
136
|
+
Stats: 'stats',
|
|
137
|
+
Alert: 'alert'
|
|
128
138
|
};
|
|
129
139
|
/**
|
|
130
140
|
* @export
|
|
@@ -138,7 +148,8 @@ exports.ContentStateUpdateColorEnum = {
|
|
|
138
148
|
Magenta: 'magenta',
|
|
139
149
|
Red: 'red',
|
|
140
150
|
Orange: 'orange',
|
|
141
|
-
Yellow: 'yellow'
|
|
151
|
+
Yellow: 'yellow',
|
|
152
|
+
Gray: 'gray'
|
|
142
153
|
};
|
|
143
154
|
/**
|
|
144
155
|
* @export
|
|
@@ -152,7 +163,8 @@ exports.ContentStateUpdateStepColorEnum = {
|
|
|
152
163
|
Magenta: 'magenta',
|
|
153
164
|
Red: 'red',
|
|
154
165
|
Orange: 'orange',
|
|
155
|
-
Yellow: 'yellow'
|
|
166
|
+
Yellow: 'yellow',
|
|
167
|
+
Gray: 'gray'
|
|
156
168
|
};
|
|
157
169
|
/**
|
|
158
170
|
* @export
|
|
@@ -166,7 +178,8 @@ exports.ContentStateUpdateStepColorsEnum = {
|
|
|
166
178
|
Magenta: 'magenta',
|
|
167
179
|
Red: 'red',
|
|
168
180
|
Orange: 'orange',
|
|
169
|
-
Yellow: 'yellow'
|
|
181
|
+
Yellow: 'yellow',
|
|
182
|
+
Gray: 'gray'
|
|
170
183
|
};
|
|
171
184
|
/**
|
|
172
185
|
*
|
|
@@ -176,6 +189,22 @@ exports.LiveActivityActionType = {
|
|
|
176
189
|
OpenUrl: 'open_url',
|
|
177
190
|
Webhook: 'webhook'
|
|
178
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
*
|
|
194
|
+
* @export
|
|
195
|
+
*/
|
|
196
|
+
exports.LiveActivityColor = {
|
|
197
|
+
Lime: 'lime',
|
|
198
|
+
Green: 'green',
|
|
199
|
+
Cyan: 'cyan',
|
|
200
|
+
Blue: 'blue',
|
|
201
|
+
Purple: 'purple',
|
|
202
|
+
Magenta: 'magenta',
|
|
203
|
+
Red: 'red',
|
|
204
|
+
Orange: 'orange',
|
|
205
|
+
Yellow: 'yellow',
|
|
206
|
+
Gray: 'gray'
|
|
207
|
+
};
|
|
179
208
|
/**
|
|
180
209
|
* @export
|
|
181
210
|
*/
|
|
@@ -223,7 +252,8 @@ exports.StreamContentStateTypeEnum = {
|
|
|
223
252
|
SegmentedProgress: 'segmented_progress',
|
|
224
253
|
Progress: 'progress',
|
|
225
254
|
Metrics: 'metrics',
|
|
226
|
-
Stats: 'stats'
|
|
255
|
+
Stats: 'stats',
|
|
256
|
+
Alert: 'alert'
|
|
227
257
|
};
|
|
228
258
|
/**
|
|
229
259
|
* @export
|
|
@@ -237,7 +267,8 @@ exports.StreamContentStateColorEnum = {
|
|
|
237
267
|
Magenta: 'magenta',
|
|
238
268
|
Red: 'red',
|
|
239
269
|
Orange: 'orange',
|
|
240
|
-
Yellow: 'yellow'
|
|
270
|
+
Yellow: 'yellow',
|
|
271
|
+
Gray: 'gray'
|
|
241
272
|
};
|
|
242
273
|
/**
|
|
243
274
|
* @export
|
|
@@ -251,7 +282,8 @@ exports.StreamContentStateStepColorEnum = {
|
|
|
251
282
|
Magenta: 'magenta',
|
|
252
283
|
Red: 'red',
|
|
253
284
|
Orange: 'orange',
|
|
254
|
-
Yellow: 'yellow'
|
|
285
|
+
Yellow: 'yellow',
|
|
286
|
+
Gray: 'gray'
|
|
255
287
|
};
|
|
256
288
|
/**
|
|
257
289
|
* @export
|
|
@@ -265,5 +297,6 @@ exports.StreamContentStateStepColorsEnum = {
|
|
|
265
297
|
Magenta: 'magenta',
|
|
266
298
|
Red: 'red',
|
|
267
299
|
Orange: 'orange',
|
|
268
|
-
Yellow: 'yellow'
|
|
300
|
+
Yellow: 'yellow',
|
|
301
|
+
Gray: 'gray'
|
|
269
302
|
};
|
|
@@ -21,12 +21,57 @@ type MetricInitOverrides = Parameters<MetricsApi["updateMetricValue"]>[1];
|
|
|
21
21
|
type PushSendRequest = PushRequestBody & {
|
|
22
22
|
channels?: string[];
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
declare const LiveActivityTypes: {
|
|
25
|
+
readonly segmentedProgress: "segmented_progress";
|
|
26
|
+
readonly progress: "progress";
|
|
27
|
+
readonly metrics: "metrics";
|
|
28
|
+
readonly stats: "stats";
|
|
29
|
+
readonly alert: "alert";
|
|
30
|
+
};
|
|
31
|
+
export type LiveActivityType = (typeof LiveActivityTypes)[keyof typeof LiveActivityTypes];
|
|
32
|
+
export type LiveActivityAlertIcon = {
|
|
33
|
+
symbol: string;
|
|
34
|
+
color?: string;
|
|
35
|
+
};
|
|
36
|
+
export type LiveActivityAlertBadge = {
|
|
37
|
+
title: string;
|
|
38
|
+
color?: string;
|
|
39
|
+
};
|
|
40
|
+
export type LiveActivityContentState = Record<string, unknown> & {
|
|
41
|
+
title?: string;
|
|
42
|
+
subtitle?: string;
|
|
43
|
+
type?: LiveActivityType | string;
|
|
44
|
+
message?: string;
|
|
45
|
+
icon?: LiveActivityAlertIcon;
|
|
46
|
+
badge?: LiveActivityAlertBadge;
|
|
47
|
+
color?: string;
|
|
48
|
+
};
|
|
49
|
+
type LiveActivityAlertIconOptions = {
|
|
50
|
+
color?: string;
|
|
51
|
+
};
|
|
52
|
+
type LiveActivityAlertBadgeOptions = {
|
|
53
|
+
color?: string;
|
|
54
|
+
};
|
|
55
|
+
type LiveStartSendRequest = Omit<StartRequestBody, "content_state"> & {
|
|
56
|
+
content_state: LiveActivityContentState;
|
|
25
57
|
channels?: string[];
|
|
26
58
|
};
|
|
27
|
-
type
|
|
59
|
+
type LiveUpdateSendRequest = Omit<UpdateRequestBody, "content_state"> & {
|
|
60
|
+
content_state: LiveActivityContentState;
|
|
61
|
+
};
|
|
62
|
+
type LiveEndSendRequest = Omit<EndRequestBody, "content_state"> & {
|
|
63
|
+
content_state: LiveActivityContentState;
|
|
64
|
+
};
|
|
65
|
+
type LiveStreamSendRequest = Omit<StreamRequestBody, "content_state"> & {
|
|
66
|
+
content_state: LiveActivityContentState;
|
|
28
67
|
channels?: string[];
|
|
29
68
|
};
|
|
69
|
+
type LiveStreamDeleteSendRequest = Omit<StreamDeleteRequestBody, "content_state"> & {
|
|
70
|
+
content_state?: LiveActivityContentState;
|
|
71
|
+
};
|
|
72
|
+
declare function contentState(value: LiveActivityContentState): LiveActivityContentState;
|
|
73
|
+
declare function alertIcon(symbol: string, options?: LiveActivityAlertIconOptions): LiveActivityAlertIcon;
|
|
74
|
+
declare function alertBadge(title: string, options?: LiveActivityAlertBadgeOptions): LiveActivityAlertBadge;
|
|
30
75
|
export declare class NotificationsResource {
|
|
31
76
|
private readonly api;
|
|
32
77
|
constructor(api: PushNotificationsApi);
|
|
@@ -40,14 +85,15 @@ export declare class LiveActivitiesResource {
|
|
|
40
85
|
readonly progress: "progress";
|
|
41
86
|
readonly metrics: "metrics";
|
|
42
87
|
readonly stats: "stats";
|
|
88
|
+
readonly alert: "alert";
|
|
43
89
|
};
|
|
44
90
|
private readonly api;
|
|
45
91
|
constructor(api: LiveActivitiesApi);
|
|
46
92
|
start(request: LiveStartSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityStartResponse>;
|
|
47
|
-
update(request:
|
|
48
|
-
end(request:
|
|
93
|
+
update(request: LiveUpdateSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityUpdateResponse>;
|
|
94
|
+
end(request: LiveEndSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityEndResponse>;
|
|
49
95
|
stream(streamKey: string, request: LiveStreamSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityStreamPutResponse>;
|
|
50
|
-
endStream(streamKey: string, request?:
|
|
96
|
+
endStream(streamKey: string, request?: LiveStreamDeleteSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityStreamDeleteResponse>;
|
|
51
97
|
startLiveActivity(...args: Parameters<LiveActivitiesApi["startLiveActivity"]>): Promise<import("../generated/models").LiveActivityStartResponse>;
|
|
52
98
|
updateLiveActivity(...args: Parameters<LiveActivitiesApi["updateLiveActivity"]>): Promise<import("../generated/models").LiveActivityUpdateResponse>;
|
|
53
99
|
endLiveActivity(...args: Parameters<LiveActivitiesApi["endLiveActivity"]>): Promise<import("../generated/models").LiveActivityEndResponse>;
|
|
@@ -72,7 +118,11 @@ export declare class ActivitySmith {
|
|
|
72
118
|
readonly progress: "progress";
|
|
73
119
|
readonly metrics: "metrics";
|
|
74
120
|
readonly stats: "stats";
|
|
121
|
+
readonly alert: "alert";
|
|
75
122
|
};
|
|
123
|
+
static readonly contentState: typeof contentState;
|
|
124
|
+
static readonly alertIcon: typeof alertIcon;
|
|
125
|
+
static readonly alertBadge: typeof alertBadge;
|
|
76
126
|
readonly notifications: NotificationsResource;
|
|
77
127
|
readonly liveActivities: LiveActivitiesResource;
|
|
78
128
|
readonly metrics: MetricsResource;
|
|
@@ -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.4.0";
|
|
6
6
|
const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
|
|
7
7
|
const SDK_HEADER_VALUE = `node-v${SDK_VERSION}`;
|
|
8
8
|
const LiveActivityTypes = {
|
|
@@ -10,6 +10,7 @@ const LiveActivityTypes = {
|
|
|
10
10
|
progress: "progress",
|
|
11
11
|
metrics: "metrics",
|
|
12
12
|
stats: "stats",
|
|
13
|
+
alert: "alert",
|
|
13
14
|
};
|
|
14
15
|
function withTargetChannels(request) {
|
|
15
16
|
const channels = request.channels;
|
|
@@ -23,6 +24,18 @@ function withTargetChannels(request) {
|
|
|
23
24
|
target: { channels },
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
function compactObject(value) {
|
|
28
|
+
return Object.fromEntries(Object.entries(value).filter(([, entryValue]) => entryValue !== undefined));
|
|
29
|
+
}
|
|
30
|
+
function contentState(value) {
|
|
31
|
+
return compactObject(value);
|
|
32
|
+
}
|
|
33
|
+
function alertIcon(symbol, options = {}) {
|
|
34
|
+
return compactObject({ symbol, color: options.color });
|
|
35
|
+
}
|
|
36
|
+
function alertBadge(title, options = {}) {
|
|
37
|
+
return compactObject({ title, color: options.color });
|
|
38
|
+
}
|
|
26
39
|
function hasMediaValue(media) {
|
|
27
40
|
if (typeof media === "string") {
|
|
28
41
|
return media.trim().length > 0;
|
|
@@ -79,7 +92,9 @@ class LiveActivitiesResource {
|
|
|
79
92
|
this.api = api;
|
|
80
93
|
}
|
|
81
94
|
start(request, initOverrides) {
|
|
82
|
-
return this.api.startLiveActivity({
|
|
95
|
+
return this.api.startLiveActivity({
|
|
96
|
+
liveActivityStartRequest: withTargetChannels(request),
|
|
97
|
+
}, initOverrides);
|
|
83
98
|
}
|
|
84
99
|
update(request, initOverrides) {
|
|
85
100
|
return this.api.updateLiveActivity({ liveActivityUpdateRequest: request }, initOverrides);
|
|
@@ -95,7 +110,10 @@ class LiveActivitiesResource {
|
|
|
95
110
|
}
|
|
96
111
|
endStream(streamKey, request, initOverrides) {
|
|
97
112
|
if (request) {
|
|
98
|
-
return this.api.endLiveActivityStream({
|
|
113
|
+
return this.api.endLiveActivityStream({
|
|
114
|
+
streamKey,
|
|
115
|
+
liveActivityStreamDeleteRequest: request,
|
|
116
|
+
}, initOverrides);
|
|
99
117
|
}
|
|
100
118
|
return this.api.endLiveActivityStream({ streamKey }, initOverrides);
|
|
101
119
|
}
|
|
@@ -171,3 +189,6 @@ class ActivitySmith {
|
|
|
171
189
|
}
|
|
172
190
|
exports.ActivitySmith = ActivitySmith;
|
|
173
191
|
ActivitySmith.liveActivityTypes = LiveActivityTypes;
|
|
192
|
+
ActivitySmith.contentState = contentState;
|
|
193
|
+
ActivitySmith.alertIcon = alertIcon;
|
|
194
|
+
ActivitySmith.alertBadge = alertBadge;
|