activitysmith 0.1.5 → 0.1.7
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
|
@@ -44,36 +44,40 @@ const activitysmith = new ActivitySmith({
|
|
|
44
44
|
const response = await activitysmith.notifications.send({
|
|
45
45
|
title: "New subscription 💸",
|
|
46
46
|
message: "Customer upgraded to Pro plan",
|
|
47
|
-
redirection:
|
|
48
|
-
"https://crm.example.com/customers/cus_9f3a1d", // Optional
|
|
49
|
-
actions: [
|
|
50
|
-
{
|
|
51
|
-
title: "Open CRM Profile",
|
|
52
|
-
type: "open_url",
|
|
53
|
-
url: "https://crm.example.com/customers/cus_9f3a1d",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
title: "Start Onboarding Workflow",
|
|
57
|
-
type: "webhook",
|
|
58
|
-
url: "https://hooks.example.com/activitysmith/onboarding/start",
|
|
59
|
-
method: "POST",
|
|
60
|
-
body: {
|
|
61
|
-
customer_id: "cus_9f3a1d",
|
|
62
|
-
plan: "pro",
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
], // Optional (max 4)
|
|
66
|
-
channels: ["sales", "customer-success"], // Optional
|
|
67
47
|
});
|
|
68
48
|
|
|
69
49
|
console.log(response.success);
|
|
70
50
|
console.log(response.devices_notified);
|
|
71
51
|
```
|
|
72
52
|
|
|
73
|
-
|
|
53
|
+
## Live Activities
|
|
54
|
+
|
|
55
|
+
Live Activities come in two UI types, but the lifecycle stays the same:
|
|
56
|
+
start the activity, keep the returned `activity_id`, update it as state
|
|
57
|
+
changes, then end it when the work is done.
|
|
58
|
+
|
|
59
|
+
- `segmented_progress`: best for jobs tracked in steps
|
|
60
|
+
- `progress`: best for jobs tracked as a percentage or numeric range
|
|
61
|
+
|
|
62
|
+
### Shared flow
|
|
63
|
+
|
|
64
|
+
1. Call `activitysmith.liveActivities.start(...)`.
|
|
65
|
+
2. Save the returned `activity_id`.
|
|
66
|
+
3. Call `activitysmith.liveActivities.update(...)` as progress changes.
|
|
67
|
+
4. Call `activitysmith.liveActivities.end(...)` when the work is finished.
|
|
68
|
+
|
|
69
|
+
### Segmented Progress Type
|
|
70
|
+
|
|
71
|
+
Use `segmented_progress` when progress is easier to follow as steps instead of a
|
|
72
|
+
raw percentage. It fits jobs like backups, deployments, ETL pipelines, and
|
|
73
|
+
checklists where "step 2 of 3" is more useful than "67%".
|
|
74
|
+
`number_of_steps` is dynamic, so you can increase or decrease it later if the
|
|
75
|
+
workflow changes.
|
|
76
|
+
|
|
77
|
+
#### Start
|
|
74
78
|
|
|
75
79
|
<p align="center">
|
|
76
|
-
<img src="https://cdn.activitysmith.com/features/start-live-activity.png" alt="
|
|
80
|
+
<img src="https://cdn.activitysmith.com/features/start-live-activity.png" alt="Segmented progress start example" width="680" />
|
|
77
81
|
</p>
|
|
78
82
|
|
|
79
83
|
```ts
|
|
@@ -92,10 +96,10 @@ const start = await activitysmith.liveActivities.start({
|
|
|
92
96
|
const activityId = start.activity_id;
|
|
93
97
|
```
|
|
94
98
|
|
|
95
|
-
|
|
99
|
+
#### Update
|
|
96
100
|
|
|
97
101
|
<p align="center">
|
|
98
|
-
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="
|
|
102
|
+
<img src="https://cdn.activitysmith.com/features/update-live-activity.png" alt="Segmented progress update example" width="680" />
|
|
99
103
|
</p>
|
|
100
104
|
|
|
101
105
|
```ts
|
|
@@ -104,6 +108,7 @@ const update = await activitysmith.liveActivities.update({
|
|
|
104
108
|
content_state: {
|
|
105
109
|
title: "Nightly database backup",
|
|
106
110
|
subtitle: "upload archive",
|
|
111
|
+
number_of_steps: 4,
|
|
107
112
|
current_step: 2,
|
|
108
113
|
},
|
|
109
114
|
});
|
|
@@ -111,10 +116,10 @@ const update = await activitysmith.liveActivities.update({
|
|
|
111
116
|
console.log(update.devices_notified);
|
|
112
117
|
```
|
|
113
118
|
|
|
114
|
-
|
|
119
|
+
#### End
|
|
115
120
|
|
|
116
121
|
<p align="center">
|
|
117
|
-
<img src="https://cdn.activitysmith.com/features/end-live-activity.png" alt="
|
|
122
|
+
<img src="https://cdn.activitysmith.com/features/end-live-activity.png" alt="Segmented progress end example" width="680" />
|
|
118
123
|
</p>
|
|
119
124
|
|
|
120
125
|
```ts
|
|
@@ -123,7 +128,8 @@ const end = await activitysmith.liveActivities.end({
|
|
|
123
128
|
content_state: {
|
|
124
129
|
title: "Nightly database backup",
|
|
125
130
|
subtitle: "verify restore",
|
|
126
|
-
|
|
131
|
+
number_of_steps: 4,
|
|
132
|
+
current_step: 4,
|
|
127
133
|
auto_dismiss_minutes: 2,
|
|
128
134
|
},
|
|
129
135
|
});
|
|
@@ -131,6 +137,109 @@ const end = await activitysmith.liveActivities.end({
|
|
|
131
137
|
console.log(end.success);
|
|
132
138
|
```
|
|
133
139
|
|
|
140
|
+
### Progress Type
|
|
141
|
+
|
|
142
|
+
Use `progress` when the state is naturally continuous. It fits charging,
|
|
143
|
+
downloads, sync jobs, uploads, timers, and any flow where a percentage or
|
|
144
|
+
numeric range is the clearest signal.
|
|
145
|
+
|
|
146
|
+
#### Start
|
|
147
|
+
|
|
148
|
+
<p align="center">
|
|
149
|
+
<img src="https://cdn.activitysmith.com/features/progress-live-activity-start.png" alt="Progress start example" width="680" />
|
|
150
|
+
</p>
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
const start = await activitysmith.liveActivities.start({
|
|
154
|
+
content_state: {
|
|
155
|
+
title: "EV Charging",
|
|
156
|
+
subtitle: "Added 30 mi range",
|
|
157
|
+
type: "progress",
|
|
158
|
+
percentage: 15,
|
|
159
|
+
color: "lime",
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
const activityId = start.activity_id;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### Update
|
|
167
|
+
|
|
168
|
+
<p align="center">
|
|
169
|
+
<img src="https://cdn.activitysmith.com/features/progress-live-activity-update.png" alt="Progress update example" width="680" />
|
|
170
|
+
</p>
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
await activitysmith.liveActivities.update({
|
|
174
|
+
activity_id: activityId,
|
|
175
|
+
content_state: {
|
|
176
|
+
title: "EV Charging",
|
|
177
|
+
subtitle: "Added 120 mi range",
|
|
178
|
+
percentage: 60,
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
#### End
|
|
184
|
+
|
|
185
|
+
<p align="center">
|
|
186
|
+
<img src="https://cdn.activitysmith.com/features/progress-live-activity-end.png" alt="Progress end example" width="680" />
|
|
187
|
+
</p>
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
await activitysmith.liveActivities.end({
|
|
191
|
+
activity_id: activityId,
|
|
192
|
+
content_state: {
|
|
193
|
+
title: "EV Charging",
|
|
194
|
+
subtitle: "Added 200 mi range",
|
|
195
|
+
percentage: 100,
|
|
196
|
+
auto_dismiss_minutes: 2,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Channels
|
|
202
|
+
|
|
203
|
+
Channels are used to target specific team members or devices. Can be used for both push notifications and live activities.
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
const response = await activitysmith.notifications.send({
|
|
207
|
+
title: "New subscription 💸",
|
|
208
|
+
message: "Customer upgraded to Pro plan",
|
|
209
|
+
channels: ["sales", "customer-success"], // Optional
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Push Notification Redirection and Actions
|
|
214
|
+
|
|
215
|
+
Push notification redirection and actions are optional and can be used to redirect the user to a specific URL when they tap the notification or to trigger a specific action when they long-press the notification.
|
|
216
|
+
Webhooks are executed by ActivitySmith backend.
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
const response = await activitysmith.notifications.send({
|
|
220
|
+
title: "New subscription 💸",
|
|
221
|
+
message: "Customer upgraded to Pro plan",
|
|
222
|
+
redirection: "https://crm.example.com/customers/cus_9f3a1d", // Optional
|
|
223
|
+
actions: [
|
|
224
|
+
{
|
|
225
|
+
title: "Open CRM Profile",
|
|
226
|
+
type: "open_url",
|
|
227
|
+
url: "https://crm.example.com/customers/cus_9f3a1d",
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
title: "Start Onboarding Workflow",
|
|
231
|
+
type: "webhook",
|
|
232
|
+
url: "https://hooks.example.com/activitysmith/onboarding/start",
|
|
233
|
+
method: "POST",
|
|
234
|
+
body: {
|
|
235
|
+
customer_id: "cus_9f3a1d",
|
|
236
|
+
plan: "pro",
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
], // Optional (max 4)
|
|
240
|
+
});
|
|
241
|
+
```
|
|
242
|
+
|
|
134
243
|
## Error Handling
|
|
135
244
|
|
|
136
245
|
```ts
|
|
@@ -143,11 +252,6 @@ try {
|
|
|
143
252
|
}
|
|
144
253
|
```
|
|
145
254
|
|
|
146
|
-
## API Surface
|
|
147
|
-
|
|
148
|
-
- `activitysmith.notifications`
|
|
149
|
-
- `activitysmith.liveActivities`
|
|
150
|
-
|
|
151
255
|
## TypeScript Support
|
|
152
256
|
|
|
153
257
|
This package is written in TypeScript and ships with type definitions out of the box.
|
|
@@ -25,32 +25,32 @@ export interface UpdateLiveActivityRequest {
|
|
|
25
25
|
*/
|
|
26
26
|
export declare class LiveActivitiesApi extends runtime.BaseAPI {
|
|
27
27
|
/**
|
|
28
|
-
* Ends a Live Activity and archives its lifecycle.
|
|
28
|
+
* Ends a Live Activity and archives its lifecycle. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
29
29
|
* End a Live Activity
|
|
30
30
|
*/
|
|
31
31
|
endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityEndResponse>>;
|
|
32
32
|
/**
|
|
33
|
-
* Ends a Live Activity and archives its lifecycle.
|
|
33
|
+
* Ends a Live Activity and archives its lifecycle. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
|
|
34
34
|
* End a Live Activity
|
|
35
35
|
*/
|
|
36
36
|
endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityEndResponse>;
|
|
37
37
|
/**
|
|
38
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
38
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
39
39
|
* Start a Live Activity
|
|
40
40
|
*/
|
|
41
41
|
startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStartResponse>>;
|
|
42
42
|
/**
|
|
43
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
43
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
44
44
|
* Start a Live Activity
|
|
45
45
|
*/
|
|
46
46
|
startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse>;
|
|
47
47
|
/**
|
|
48
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
|
|
48
|
+
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
49
49
|
* Update a Live Activity
|
|
50
50
|
*/
|
|
51
51
|
updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityUpdateResponse>>;
|
|
52
52
|
/**
|
|
53
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
|
|
53
|
+
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
54
54
|
* Update a Live Activity
|
|
55
55
|
*/
|
|
56
56
|
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
|
-
* Ends a Live Activity and archives its lifecycle.
|
|
23
|
+
* Ends a Live Activity and archives its lifecycle. 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
|
|
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
|
-
* Ends a Live Activity and archives its lifecycle.
|
|
50
|
+
* Ends a Live Activity and archives its lifecycle. 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
|
|
52
52
|
*/
|
|
53
53
|
async endLiveActivity(requestParameters, initOverrides) {
|
|
@@ -55,7 +55,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
55
55
|
return await response.value();
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
58
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
59
59
|
* Start a Live Activity
|
|
60
60
|
*/
|
|
61
61
|
async startLiveActivityRaw(requestParameters, initOverrides) {
|
|
@@ -82,7 +82,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
82
82
|
return new runtime.JSONApiResponse(response);
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Starts a Live Activity on devices matched by API key scope and optional target channels.
|
|
85
|
+
* Starts a Live Activity on devices matched by API key scope and optional target channels. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
|
|
86
86
|
* Start a Live Activity
|
|
87
87
|
*/
|
|
88
88
|
async startLiveActivity(requestParameters, initOverrides) {
|
|
@@ -90,7 +90,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
90
90
|
return await response.value();
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
|
|
93
|
+
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
94
94
|
* Update a Live Activity
|
|
95
95
|
*/
|
|
96
96
|
async updateLiveActivityRaw(requestParameters, initOverrides) {
|
|
@@ -117,7 +117,7 @@ class LiveActivitiesApi extends runtime.BaseAPI {
|
|
|
117
117
|
return new runtime.JSONApiResponse(response);
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
|
-
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued.
|
|
120
|
+
* Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
|
|
121
121
|
* Update a Live Activity
|
|
122
122
|
*/
|
|
123
123
|
async updateLiveActivity(requestParameters, initOverrides) {
|
|
@@ -53,7 +53,7 @@ export interface ChannelTarget {
|
|
|
53
53
|
channels: Array<string>;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* End payload.
|
|
56
|
+
* End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start.
|
|
57
57
|
* @export
|
|
58
58
|
* @interface ContentStateEnd
|
|
59
59
|
*/
|
|
@@ -72,17 +72,41 @@ export interface ContentStateEnd {
|
|
|
72
72
|
*/
|
|
73
73
|
subtitle?: string;
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Total number of steps. Use for type=segmented_progress. Optional on end, and safe to change if the final workflow used more or fewer steps than originally planned.
|
|
76
76
|
* @type {number}
|
|
77
77
|
* @memberof ContentStateEnd
|
|
78
78
|
*/
|
|
79
79
|
number_of_steps?: number;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* Current step. Use for type=segmented_progress.
|
|
82
82
|
* @type {number}
|
|
83
83
|
* @memberof ContentStateEnd
|
|
84
84
|
*/
|
|
85
|
-
current_step
|
|
85
|
+
current_step?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
88
|
+
* @type {number}
|
|
89
|
+
* @memberof ContentStateEnd
|
|
90
|
+
*/
|
|
91
|
+
percentage?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Current progress value. Use with upper_limit for type=progress.
|
|
94
|
+
* @type {number}
|
|
95
|
+
* @memberof ContentStateEnd
|
|
96
|
+
*/
|
|
97
|
+
value?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Maximum progress value. Use with value for type=progress.
|
|
100
|
+
* @type {number}
|
|
101
|
+
* @memberof ContentStateEnd
|
|
102
|
+
*/
|
|
103
|
+
upper_limit?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Optional. When omitted, the API uses the existing Live Activity type.
|
|
106
|
+
* @type {string}
|
|
107
|
+
* @memberof ContentStateEnd
|
|
108
|
+
*/
|
|
109
|
+
type?: ContentStateEndTypeEnum;
|
|
86
110
|
/**
|
|
87
111
|
* Optional. Accent color for the Live Activity. Defaults to blue.
|
|
88
112
|
* @type {string}
|
|
@@ -90,7 +114,7 @@ export interface ContentStateEnd {
|
|
|
90
114
|
*/
|
|
91
115
|
color?: ContentStateEndColorEnum;
|
|
92
116
|
/**
|
|
93
|
-
* Optional. Overrides color for the current step.
|
|
117
|
+
* Optional. Overrides color for the current step. Only applies to type=segmented_progress.
|
|
94
118
|
* @type {string}
|
|
95
119
|
* @memberof ContentStateEnd
|
|
96
120
|
*/
|
|
@@ -102,6 +126,14 @@ export interface ContentStateEnd {
|
|
|
102
126
|
*/
|
|
103
127
|
auto_dismiss_minutes?: number;
|
|
104
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* @export
|
|
131
|
+
*/
|
|
132
|
+
export declare const ContentStateEndTypeEnum: {
|
|
133
|
+
readonly SegmentedProgress: "segmented_progress";
|
|
134
|
+
readonly Progress: "progress";
|
|
135
|
+
};
|
|
136
|
+
export type ContentStateEndTypeEnum = typeof ContentStateEndTypeEnum[keyof typeof ContentStateEndTypeEnum];
|
|
105
137
|
/**
|
|
106
138
|
* @export
|
|
107
139
|
*/
|
|
@@ -133,7 +165,7 @@ export declare const ContentStateEndStepColorEnum: {
|
|
|
133
165
|
};
|
|
134
166
|
export type ContentStateEndStepColorEnum = typeof ContentStateEndStepColorEnum[keyof typeof ContentStateEndStepColorEnum];
|
|
135
167
|
/**
|
|
136
|
-
* Start payload requires title
|
|
168
|
+
* 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 segmented_progress, number_of_steps is not locked and can be changed in later update or end calls.
|
|
137
169
|
* @export
|
|
138
170
|
* @interface ContentStateStart
|
|
139
171
|
*/
|
|
@@ -152,17 +184,35 @@ export interface ContentStateStart {
|
|
|
152
184
|
*/
|
|
153
185
|
subtitle?: string;
|
|
154
186
|
/**
|
|
155
|
-
*
|
|
187
|
+
* Total number of steps. Use for type=segmented_progress. This value can be increased or decreased later when updating or ending the same activity.
|
|
156
188
|
* @type {number}
|
|
157
189
|
* @memberof ContentStateStart
|
|
158
190
|
*/
|
|
159
|
-
number_of_steps
|
|
191
|
+
number_of_steps?: number;
|
|
160
192
|
/**
|
|
161
|
-
*
|
|
193
|
+
* Current step. Use for type=segmented_progress.
|
|
194
|
+
* @type {number}
|
|
195
|
+
* @memberof ContentStateStart
|
|
196
|
+
*/
|
|
197
|
+
current_step?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
200
|
+
* @type {number}
|
|
201
|
+
* @memberof ContentStateStart
|
|
202
|
+
*/
|
|
203
|
+
percentage?: number;
|
|
204
|
+
/**
|
|
205
|
+
* Current progress value. Use with upper_limit for type=progress.
|
|
162
206
|
* @type {number}
|
|
163
207
|
* @memberof ContentStateStart
|
|
164
208
|
*/
|
|
165
|
-
|
|
209
|
+
value?: number;
|
|
210
|
+
/**
|
|
211
|
+
* Maximum progress value. Use with value for type=progress.
|
|
212
|
+
* @type {number}
|
|
213
|
+
* @memberof ContentStateStart
|
|
214
|
+
*/
|
|
215
|
+
upper_limit?: number;
|
|
166
216
|
/**
|
|
167
217
|
*
|
|
168
218
|
* @type {string}
|
|
@@ -176,7 +226,7 @@ export interface ContentStateStart {
|
|
|
176
226
|
*/
|
|
177
227
|
color?: ContentStateStartColorEnum;
|
|
178
228
|
/**
|
|
179
|
-
* Optional. Overrides color for the current step.
|
|
229
|
+
* Optional. Overrides color for the current step. Only applies to type=segmented_progress.
|
|
180
230
|
* @type {string}
|
|
181
231
|
* @memberof ContentStateStart
|
|
182
232
|
*/
|
|
@@ -187,6 +237,7 @@ export interface ContentStateStart {
|
|
|
187
237
|
*/
|
|
188
238
|
export declare const ContentStateStartTypeEnum: {
|
|
189
239
|
readonly SegmentedProgress: "segmented_progress";
|
|
240
|
+
readonly Progress: "progress";
|
|
190
241
|
};
|
|
191
242
|
export type ContentStateStartTypeEnum = typeof ContentStateStartTypeEnum[keyof typeof ContentStateStartTypeEnum];
|
|
192
243
|
/**
|
|
@@ -220,7 +271,7 @@ export declare const ContentStateStartStepColorEnum: {
|
|
|
220
271
|
};
|
|
221
272
|
export type ContentStateStartStepColorEnum = typeof ContentStateStartStepColorEnum[keyof typeof ContentStateStartStepColorEnum];
|
|
222
273
|
/**
|
|
223
|
-
* Update payload.
|
|
274
|
+
* Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
|
|
224
275
|
* @export
|
|
225
276
|
* @interface ContentStateUpdate
|
|
226
277
|
*/
|
|
@@ -239,17 +290,41 @@ export interface ContentStateUpdate {
|
|
|
239
290
|
*/
|
|
240
291
|
subtitle?: string;
|
|
241
292
|
/**
|
|
242
|
-
*
|
|
293
|
+
* Total number of steps. Use for type=segmented_progress. Optional on update, and safe to change if the workflow gains or loses steps.
|
|
243
294
|
* @type {number}
|
|
244
295
|
* @memberof ContentStateUpdate
|
|
245
296
|
*/
|
|
246
297
|
number_of_steps?: number;
|
|
247
298
|
/**
|
|
248
|
-
*
|
|
299
|
+
* Current step. Use for type=segmented_progress.
|
|
249
300
|
* @type {number}
|
|
250
301
|
* @memberof ContentStateUpdate
|
|
251
302
|
*/
|
|
252
|
-
current_step
|
|
303
|
+
current_step?: number;
|
|
304
|
+
/**
|
|
305
|
+
* Progress percentage (0–100). Use for type=progress. Takes precedence over value/upper_limit if both are provided.
|
|
306
|
+
* @type {number}
|
|
307
|
+
* @memberof ContentStateUpdate
|
|
308
|
+
*/
|
|
309
|
+
percentage?: number;
|
|
310
|
+
/**
|
|
311
|
+
* Current progress value. Use with upper_limit for type=progress.
|
|
312
|
+
* @type {number}
|
|
313
|
+
* @memberof ContentStateUpdate
|
|
314
|
+
*/
|
|
315
|
+
value?: number;
|
|
316
|
+
/**
|
|
317
|
+
* Maximum progress value. Use with value for type=progress.
|
|
318
|
+
* @type {number}
|
|
319
|
+
* @memberof ContentStateUpdate
|
|
320
|
+
*/
|
|
321
|
+
upper_limit?: number;
|
|
322
|
+
/**
|
|
323
|
+
* Optional. When omitted, the API uses the existing Live Activity type.
|
|
324
|
+
* @type {string}
|
|
325
|
+
* @memberof ContentStateUpdate
|
|
326
|
+
*/
|
|
327
|
+
type?: ContentStateUpdateTypeEnum;
|
|
253
328
|
/**
|
|
254
329
|
* Optional. Accent color for the Live Activity. Defaults to blue.
|
|
255
330
|
* @type {string}
|
|
@@ -257,12 +332,20 @@ export interface ContentStateUpdate {
|
|
|
257
332
|
*/
|
|
258
333
|
color?: ContentStateUpdateColorEnum;
|
|
259
334
|
/**
|
|
260
|
-
* Optional. Overrides color for the current step.
|
|
335
|
+
* Optional. Overrides color for the current step. Only applies to type=segmented_progress.
|
|
261
336
|
* @type {string}
|
|
262
337
|
* @memberof ContentStateUpdate
|
|
263
338
|
*/
|
|
264
339
|
step_color?: ContentStateUpdateStepColorEnum;
|
|
265
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* @export
|
|
343
|
+
*/
|
|
344
|
+
export declare const ContentStateUpdateTypeEnum: {
|
|
345
|
+
readonly SegmentedProgress: "segmented_progress";
|
|
346
|
+
readonly Progress: "progress";
|
|
347
|
+
};
|
|
348
|
+
export type ContentStateUpdateTypeEnum = typeof ContentStateUpdateTypeEnum[keyof typeof ContentStateUpdateTypeEnum];
|
|
266
349
|
/**
|
|
267
350
|
* @export
|
|
268
351
|
*/
|
|
@@ -314,7 +397,7 @@ export interface ForbiddenError {
|
|
|
314
397
|
message: string;
|
|
315
398
|
}
|
|
316
399
|
/**
|
|
317
|
-
*
|
|
400
|
+
* End an existing Live Activity by activity_id.
|
|
318
401
|
* @export
|
|
319
402
|
* @interface LiveActivityEndRequest
|
|
320
403
|
*/
|
|
@@ -334,7 +417,7 @@ export interface LiveActivityEndRequest {
|
|
|
334
417
|
content_state: ContentStateEnd;
|
|
335
418
|
}
|
|
336
419
|
/**
|
|
337
|
-
*
|
|
420
|
+
* Returned after a Live Activity end event is sent or queued.
|
|
338
421
|
* @export
|
|
339
422
|
* @interface LiveActivityEndResponse
|
|
340
423
|
*/
|
|
@@ -404,7 +487,7 @@ export interface LiveActivityLimitError {
|
|
|
404
487
|
active: number;
|
|
405
488
|
}
|
|
406
489
|
/**
|
|
407
|
-
*
|
|
490
|
+
* Start a new Live Activity. The response includes activity_id for later update and end calls.
|
|
408
491
|
* @export
|
|
409
492
|
* @interface LiveActivityStartRequest
|
|
410
493
|
*/
|
|
@@ -430,7 +513,7 @@ export interface LiveActivityStartRequest {
|
|
|
430
513
|
target?: ChannelTarget;
|
|
431
514
|
}
|
|
432
515
|
/**
|
|
433
|
-
*
|
|
516
|
+
* Returned after a Live Activity starts. Save activity_id and use it for all later updates and for the final end call.
|
|
434
517
|
* @export
|
|
435
518
|
* @interface LiveActivityStartResponse
|
|
436
519
|
*/
|
|
@@ -474,7 +557,7 @@ export interface LiveActivityStartResponse {
|
|
|
474
557
|
timestamp: string;
|
|
475
558
|
}
|
|
476
559
|
/**
|
|
477
|
-
*
|
|
560
|
+
* Update an existing Live Activity by activity_id.
|
|
478
561
|
* @export
|
|
479
562
|
* @interface LiveActivityUpdateRequest
|
|
480
563
|
*/
|
|
@@ -494,7 +577,7 @@ export interface LiveActivityUpdateRequest {
|
|
|
494
577
|
content_state: ContentStateUpdate;
|
|
495
578
|
}
|
|
496
579
|
/**
|
|
497
|
-
*
|
|
580
|
+
* Returned after a Live Activity update is sent or queued.
|
|
498
581
|
* @export
|
|
499
582
|
* @interface LiveActivityUpdateResponse
|
|
500
583
|
*/
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PushNotificationWebhookMethod = exports.PushNotificationActionType = exports.ContentStateUpdateStepColorEnum = exports.ContentStateUpdateColorEnum = exports.ContentStateStartStepColorEnum = exports.ContentStateStartColorEnum = exports.ContentStateStartTypeEnum = exports.ContentStateEndStepColorEnum = exports.ContentStateEndColorEnum = void 0;
|
|
3
|
+
exports.PushNotificationWebhookMethod = exports.PushNotificationActionType = exports.ContentStateUpdateStepColorEnum = exports.ContentStateUpdateColorEnum = exports.ContentStateUpdateTypeEnum = exports.ContentStateStartStepColorEnum = exports.ContentStateStartColorEnum = exports.ContentStateStartTypeEnum = exports.ContentStateEndStepColorEnum = exports.ContentStateEndColorEnum = exports.ContentStateEndTypeEnum = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @export
|
|
6
|
+
*/
|
|
7
|
+
exports.ContentStateEndTypeEnum = {
|
|
8
|
+
SegmentedProgress: 'segmented_progress',
|
|
9
|
+
Progress: 'progress'
|
|
10
|
+
};
|
|
4
11
|
/**
|
|
5
12
|
* @export
|
|
6
13
|
*/
|
|
@@ -33,7 +40,8 @@ exports.ContentStateEndStepColorEnum = {
|
|
|
33
40
|
* @export
|
|
34
41
|
*/
|
|
35
42
|
exports.ContentStateStartTypeEnum = {
|
|
36
|
-
SegmentedProgress: 'segmented_progress'
|
|
43
|
+
SegmentedProgress: 'segmented_progress',
|
|
44
|
+
Progress: 'progress'
|
|
37
45
|
};
|
|
38
46
|
/**
|
|
39
47
|
* @export
|
|
@@ -63,6 +71,13 @@ exports.ContentStateStartStepColorEnum = {
|
|
|
63
71
|
Orange: 'orange',
|
|
64
72
|
Yellow: 'yellow'
|
|
65
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* @export
|
|
76
|
+
*/
|
|
77
|
+
exports.ContentStateUpdateTypeEnum = {
|
|
78
|
+
SegmentedProgress: 'segmented_progress',
|
|
79
|
+
Progress: 'progress'
|
|
80
|
+
};
|
|
66
81
|
/**
|
|
67
82
|
* @export
|
|
68
83
|
*/
|