activitysmith 1.2.1 → 1.3.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
@@ -17,6 +17,7 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction)
17
17
  - [Live Activities](#live-activities)
18
18
  - [Simple: Let ActivitySmith manage the Live Activity for you](#simple-let-activitysmith-manage-the-live-activity-for-you)
19
19
  - [Advanced: Full lifecycle control](#advanced-full-lifecycle-control)
20
+ - [Stats Type](#stats-type)
20
21
  - [Metrics Type](#metrics-type)
21
22
  - [Segmented Progress Type](#segmented-progress-type)
22
23
  - [Progress Type](#progress-type)
@@ -133,8 +134,9 @@ await activitysmith.notifications.send({
133
134
  <img src="https://cdn.activitysmith.com/features/metrics-live-activity-action.png" alt="Metrics Live Activity screenshot" width="680" />
134
135
  </p>
135
136
 
136
- There are three types of Live Activities:
137
+ There are four types of Live Activities:
137
138
 
139
+ - `stats`: best for compact business or product stats like revenue, orders, conversion, and average order value
138
140
  - `metrics`: best for live operational stats like server CPU and memory, queue depth, or replica lag
139
141
  - `segmented_progress`: best for step-based workflows like deployments, backups, and ETL pipelines
140
142
  - `progress`: best for continuous jobs like uploads, reindexes, and long-running migrations tracked as a percentage
@@ -154,6 +156,30 @@ such as a server, deployment, or build pipeline.
154
156
  This is especially useful for cron jobs and other scheduled tasks where you do
155
157
  not want to store `activity_id` between runs.
156
158
 
159
+ #### Stats
160
+
161
+ <p align="center">
162
+ <img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats stream example" width="680" />
163
+ </p>
164
+
165
+ ```ts
166
+ const status = await activitysmith.liveActivities.stream("sales-hourly", {
167
+ content_state: {
168
+ title: "Sales",
169
+ subtitle: "last hour",
170
+ type: "stats",
171
+ metrics: [
172
+ { label: "Revenue", value: "$2430", color: "blue" },
173
+ { label: "Orders", value: "37", color: "green" },
174
+ { label: "Conversion", value: "4.8%", color: "magenta" },
175
+ { label: "Avg Order", value: "$65.68", color: "yellow" },
176
+ { label: "Refunds", value: "$84", color: "red" },
177
+ { label: "New Buyers", value: "18", color: "cyan" },
178
+ ],
179
+ },
180
+ });
181
+ ```
182
+
157
183
  #### Metrics
158
184
 
159
185
  <p align="center">
@@ -252,6 +278,83 @@ Use these methods when you want to manage the Live Activity lifecycle yourself:
252
278
  3. Call `activitysmith.liveActivities.update(...)` as progress changes.
253
279
  4. Call `activitysmith.liveActivities.end(...)` when the work is finished.
254
280
 
281
+ ### Stats Type
282
+
283
+ Keep your key numbers on your Lock Screen. `stats` fits 1 to 8 labeled values,
284
+ such as revenue, orders, conversion, uptime, or any other business metric you
285
+ want visible at a glance. Each metric can use a formatted string or number as
286
+ its `value`. Add `color` to a metric to show an accent dot next to its label;
287
+ omit `color` to show the label without a dot.
288
+
289
+ #### Start
290
+
291
+ <p align="center">
292
+ <img src="https://cdn.activitysmith.com/features/stats-live-activity.png" alt="Stats Live Activity with sales revenue, orders, conversion, and average order value" width="680" />
293
+ </p>
294
+
295
+ ```ts
296
+ const start = await activitysmith.liveActivities.start({
297
+ content_state: {
298
+ title: "Sales",
299
+ subtitle: "last hour",
300
+ type: "stats",
301
+ metrics: [
302
+ { label: "Revenue", value: "$2430", color: "blue" },
303
+ { label: "Orders", value: "37", color: "green" },
304
+ { label: "Conversion", value: "4.8%", color: "magenta" },
305
+ { label: "Avg Order", value: "$65.68", color: "yellow" },
306
+ { label: "Refunds", value: "$84", color: "red" },
307
+ { label: "New Buyers", value: "18", color: "cyan" },
308
+ ],
309
+ },
310
+ });
311
+
312
+ const activityId = start.activity_id;
313
+ ```
314
+
315
+ #### Update
316
+
317
+ ```ts
318
+ await activitysmith.liveActivities.update({
319
+ activity_id: activityId,
320
+ content_state: {
321
+ title: "Sales",
322
+ subtitle: "last hour",
323
+ type: "stats",
324
+ metrics: [
325
+ { label: "Revenue", value: "$3180", color: "blue" },
326
+ { label: "Orders", value: "51", color: "green" },
327
+ { label: "Conversion", value: "5.2%", color: "magenta" },
328
+ { label: "Avg Order", value: "$62.35", color: "yellow" },
329
+ { label: "Refunds", value: "$126", color: "red" },
330
+ { label: "New Buyers", value: "24", color: "cyan" },
331
+ ],
332
+ },
333
+ });
334
+ ```
335
+
336
+ #### End
337
+
338
+ ```ts
339
+ await activitysmith.liveActivities.end({
340
+ activity_id: activityId,
341
+ content_state: {
342
+ title: "Sales",
343
+ subtitle: "last hour",
344
+ type: "stats",
345
+ metrics: [
346
+ { label: "Revenue", value: "$3460", color: "blue" },
347
+ { label: "Orders", value: "58", color: "green" },
348
+ { label: "Conversion", value: "5.4%", color: "magenta" },
349
+ { label: "Avg Order", value: "$59.66", color: "yellow" },
350
+ { label: "Refunds", value: "$92", color: "red" },
351
+ { label: "New Buyers", value: "31", color: "cyan" },
352
+ ],
353
+ auto_dismiss_minutes: 2,
354
+ },
355
+ });
356
+ ```
357
+
255
358
  ### Metrics Type
256
359
 
257
360
  Use `metrics` when you want to keep a small set of live stats visible, such as
@@ -33,12 +33,12 @@ export interface UpdateLiveActivityRequest {
33
33
  */
34
34
  export declare class LiveActivitiesApi extends runtime.BaseAPI {
35
35
  /**
36
- * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
36
+ * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
37
37
  * End a Live Activity
38
38
  */
39
39
  endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityEndResponse>>;
40
40
  /**
41
- * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
41
+ * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
42
42
  * End a Live Activity
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
- * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
66
+ * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
67
67
  * Start a Live Activity
68
68
  */
69
69
  startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityStartResponse>>;
70
70
  /**
71
- * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
71
+ * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
72
72
  * Start a Live Activity
73
73
  */
74
74
  startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveActivityStartResponse>;
75
75
  /**
76
- * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
76
+ * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
77
77
  * Update a Live Activity
78
78
  */
79
79
  updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveActivityUpdateResponse>>;
80
80
  /**
81
- * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
81
+ * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
82
82
  * Update a Live Activity
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
- * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
23
+ * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
24
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. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
50
+ * Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start.
51
51
  * End a Live Activity
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
- * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
131
+ * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
132
132
  * Start a Live Activity
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
- * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
158
+ * Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes.
159
159
  * Start a Live Activity
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
- * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
166
+ * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
167
167
  * Update a Live Activity
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
- * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, and metrics activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
193
+ * Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, and stats activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes.
194
194
  * Update a Live Activity
195
195
  */
196
196
  async updateLiveActivity(requestParameters, initOverrides) {
@@ -13,17 +13,44 @@ export interface ActivityMetric {
13
13
  label: string;
14
14
  /**
15
15
  *
16
- * @type {number}
16
+ * @type {ActivityMetricValue}
17
17
  * @memberof ActivityMetric
18
18
  */
19
- value: number;
19
+ value: ActivityMetricValue;
20
20
  /**
21
21
  *
22
22
  * @type {string}
23
23
  * @memberof ActivityMetric
24
24
  */
25
25
  unit?: string;
26
+ /**
27
+ * Optional per-metric accent color for metrics and stats activities.
28
+ * @type {string}
29
+ * @memberof ActivityMetric
30
+ */
31
+ color?: ActivityMetricColorEnum;
26
32
  }
33
+ /**
34
+ * @export
35
+ */
36
+ export declare const ActivityMetricColorEnum: {
37
+ readonly Lime: "lime";
38
+ readonly Green: "green";
39
+ readonly Cyan: "cyan";
40
+ readonly Blue: "blue";
41
+ readonly Purple: "purple";
42
+ readonly Magenta: "magenta";
43
+ readonly Red: "red";
44
+ readonly Orange: "orange";
45
+ readonly Yellow: "yellow";
46
+ };
47
+ export type ActivityMetricColorEnum = typeof ActivityMetricColorEnum[keyof typeof ActivityMetricColorEnum];
48
+ /**
49
+ * @type ActivityMetricValue
50
+ *
51
+ * @export
52
+ */
53
+ export type ActivityMetricValue = number | string;
27
54
  /**
28
55
  *
29
56
  * @export
@@ -79,7 +106,7 @@ export interface ChannelTarget {
79
106
  channels: Array<string>;
80
107
  }
81
108
  /**
82
- * 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 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.
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.
83
110
  * @export
84
111
  * @interface ContentStateEnd
85
112
  */
@@ -128,7 +155,7 @@ export interface ContentStateEnd {
128
155
  */
129
156
  upper_limit?: number;
130
157
  /**
131
- * Use for type=metrics.
158
+ * Use for type=metrics or type=stats.
132
159
  * @type {Array<ActivityMetric>}
133
160
  * @memberof ContentStateEnd
134
161
  */
@@ -171,6 +198,7 @@ export declare const ContentStateEndTypeEnum: {
171
198
  readonly SegmentedProgress: "segmented_progress";
172
199
  readonly Progress: "progress";
173
200
  readonly Metrics: "metrics";
201
+ readonly Stats: "stats";
174
202
  };
175
203
  export type ContentStateEndTypeEnum = typeof ContentStateEndTypeEnum[keyof typeof ContentStateEndTypeEnum];
176
204
  /**
@@ -219,7 +247,7 @@ export declare const ContentStateEndStepColorsEnum: {
219
247
  };
220
248
  export type ContentStateEndStepColorsEnum = typeof ContentStateEndStepColorsEnum[keyof typeof ContentStateEndStepColorsEnum];
221
249
  /**
222
- * 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 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.
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.
223
251
  * @export
224
252
  * @interface ContentStateStart
225
253
  */
@@ -268,7 +296,7 @@ export interface ContentStateStart {
268
296
  */
269
297
  upper_limit?: number;
270
298
  /**
271
- * Use for type=metrics.
299
+ * Use for type=metrics or type=stats.
272
300
  * @type {Array<ActivityMetric>}
273
301
  * @memberof ContentStateStart
274
302
  */
@@ -305,6 +333,7 @@ export declare const ContentStateStartTypeEnum: {
305
333
  readonly SegmentedProgress: "segmented_progress";
306
334
  readonly Progress: "progress";
307
335
  readonly Metrics: "metrics";
336
+ readonly Stats: "stats";
308
337
  };
309
338
  export type ContentStateStartTypeEnum = typeof ContentStateStartTypeEnum[keyof typeof ContentStateStartTypeEnum];
310
339
  /**
@@ -353,7 +382,7 @@ export declare const ContentStateStartStepColorsEnum: {
353
382
  };
354
383
  export type ContentStateStartStepColorsEnum = typeof ContentStateStartStepColorsEnum[keyof typeof ContentStateStartStepColorsEnum];
355
384
  /**
356
- * 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 include a non-empty metrics array. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates.
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.
357
386
  * @export
358
387
  * @interface ContentStateUpdate
359
388
  */
@@ -402,7 +431,7 @@ export interface ContentStateUpdate {
402
431
  */
403
432
  upper_limit?: number;
404
433
  /**
405
- * Use for type=metrics.
434
+ * Use for type=metrics or type=stats.
406
435
  * @type {Array<ActivityMetric>}
407
436
  * @memberof ContentStateUpdate
408
437
  */
@@ -439,6 +468,7 @@ export declare const ContentStateUpdateTypeEnum: {
439
468
  readonly SegmentedProgress: "segmented_progress";
440
469
  readonly Progress: "progress";
441
470
  readonly Metrics: "metrics";
471
+ readonly Stats: "stats";
442
472
  };
443
473
  export type ContentStateUpdateTypeEnum = typeof ContentStateUpdateTypeEnum[keyof typeof ContentStateUpdateTypeEnum];
444
474
  /**
@@ -1299,7 +1329,7 @@ export interface RateLimitError {
1299
1329
  */
1300
1330
  export type SendPushNotification429Response = LiveActivityLimitError | RateLimitError;
1301
1331
  /**
1302
- * 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, and metrics types.
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 stats types.
1303
1333
  * @export
1304
1334
  * @interface StreamContentState
1305
1335
  */
@@ -1372,7 +1402,7 @@ export interface StreamContentState {
1372
1402
  */
1373
1403
  step_colors?: Array<StreamContentStateStepColorsEnum>;
1374
1404
  /**
1375
- * Use for metrics activities.
1405
+ * Use for metrics and stats activities.
1376
1406
  * @type {Array<ActivityMetric>}
1377
1407
  * @memberof StreamContentState
1378
1408
  */
@@ -1397,6 +1427,7 @@ export declare const StreamContentStateTypeEnum: {
1397
1427
  readonly SegmentedProgress: "segmented_progress";
1398
1428
  readonly Progress: "progress";
1399
1429
  readonly Metrics: "metrics";
1430
+ readonly Stats: "stats";
1400
1431
  };
1401
1432
  export type StreamContentStateTypeEnum = typeof StreamContentStateTypeEnum[keyof typeof StreamContentStateTypeEnum];
1402
1433
  /**
@@ -1,13 +1,28 @@
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 = void 0;
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;
4
+ /**
5
+ * @export
6
+ */
7
+ exports.ActivityMetricColorEnum = {
8
+ Lime: 'lime',
9
+ Green: 'green',
10
+ Cyan: 'cyan',
11
+ Blue: 'blue',
12
+ Purple: 'purple',
13
+ Magenta: 'magenta',
14
+ Red: 'red',
15
+ Orange: 'orange',
16
+ Yellow: 'yellow'
17
+ };
4
18
  /**
5
19
  * @export
6
20
  */
7
21
  exports.ContentStateEndTypeEnum = {
8
22
  SegmentedProgress: 'segmented_progress',
9
23
  Progress: 'progress',
10
- Metrics: 'metrics'
24
+ Metrics: 'metrics',
25
+ Stats: 'stats'
11
26
  };
12
27
  /**
13
28
  * @export
@@ -57,7 +72,8 @@ exports.ContentStateEndStepColorsEnum = {
57
72
  exports.ContentStateStartTypeEnum = {
58
73
  SegmentedProgress: 'segmented_progress',
59
74
  Progress: 'progress',
60
- Metrics: 'metrics'
75
+ Metrics: 'metrics',
76
+ Stats: 'stats'
61
77
  };
62
78
  /**
63
79
  * @export
@@ -107,7 +123,8 @@ exports.ContentStateStartStepColorsEnum = {
107
123
  exports.ContentStateUpdateTypeEnum = {
108
124
  SegmentedProgress: 'segmented_progress',
109
125
  Progress: 'progress',
110
- Metrics: 'metrics'
126
+ Metrics: 'metrics',
127
+ Stats: 'stats'
111
128
  };
112
129
  /**
113
130
  * @export
@@ -205,7 +222,8 @@ exports.PushNotificationWebhookMethod = {
205
222
  exports.StreamContentStateTypeEnum = {
206
223
  SegmentedProgress: 'segmented_progress',
207
224
  Progress: 'progress',
208
- Metrics: 'metrics'
225
+ Metrics: 'metrics',
226
+ Stats: 'stats'
209
227
  };
210
228
  /**
211
229
  * @export
@@ -176,12 +176,17 @@ class BaseAPI {
176
176
  body: context.body,
177
177
  credentials: this.configuration.credentials,
178
178
  };
179
+ const override = await initOverrideFn({
180
+ init: initParams,
181
+ context,
182
+ });
179
183
  const overriddenInit = {
180
184
  ...initParams,
181
- ...(await initOverrideFn({
182
- init: initParams,
183
- context,
184
- }))
185
+ ...override,
186
+ headers: {
187
+ ...headers,
188
+ ...(override?.headers || {}),
189
+ },
185
190
  };
186
191
  let body;
187
192
  if (isFormData(overriddenInit.body)
@@ -35,6 +35,12 @@ export declare class NotificationsResource {
35
35
  sendPushNotificationRaw(requestParameters: PushRawParameters, initOverrides?: SendInitOverrides): Promise<import("../generated/runtime").ApiResponse<import("../generated/models").PushNotificationResponse>>;
36
36
  }
37
37
  export declare class LiveActivitiesResource {
38
+ static readonly types: {
39
+ readonly segmentedProgress: "segmented_progress";
40
+ readonly progress: "progress";
41
+ readonly metrics: "metrics";
42
+ readonly stats: "stats";
43
+ };
38
44
  private readonly api;
39
45
  constructor(api: LiveActivitiesApi);
40
46
  start(request: LiveStartSendRequest, initOverrides?: LiveInitOverrides): Promise<import("../generated/models").LiveActivityStartResponse>;
@@ -61,6 +67,12 @@ export declare class MetricsResource {
61
67
  updateMetricValueRaw(requestParameters: MetricRawParameters, initOverrides?: MetricInitOverrides): Promise<import("../generated/runtime").ApiResponse<import("../generated/models").MetricValueUpdateResponse>>;
62
68
  }
63
69
  export declare class ActivitySmith {
70
+ static readonly liveActivityTypes: {
71
+ readonly segmentedProgress: "segmented_progress";
72
+ readonly progress: "progress";
73
+ readonly metrics: "metrics";
74
+ readonly stats: "stats";
75
+ };
64
76
  readonly notifications: NotificationsResource;
65
77
  readonly liveActivities: LiveActivitiesResource;
66
78
  readonly metrics: MetricsResource;
@@ -2,9 +2,15 @@
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.1.0";
5
+ const SDK_VERSION = "1.3.0";
6
6
  const SDK_HEADER_NAME = "X-ActivitySmith-SDK";
7
7
  const SDK_HEADER_VALUE = `node-v${SDK_VERSION}`;
8
+ const LiveActivityTypes = {
9
+ segmentedProgress: "segmented_progress",
10
+ progress: "progress",
11
+ metrics: "metrics",
12
+ stats: "stats",
13
+ };
8
14
  function withTargetChannels(request) {
9
15
  const channels = request.channels;
10
16
  if (!channels || channels.length === 0 || request.target) {
@@ -126,6 +132,7 @@ class LiveActivitiesResource {
126
132
  }
127
133
  }
128
134
  exports.LiveActivitiesResource = LiveActivitiesResource;
135
+ LiveActivitiesResource.types = LiveActivityTypes;
129
136
  class MetricsResource {
130
137
  constructor(api) {
131
138
  this.api = api;
@@ -163,3 +170,4 @@ class ActivitySmith {
163
170
  }
164
171
  }
165
172
  exports.ActivitySmith = ActivitySmith;
173
+ ActivitySmith.liveActivityTypes = LiveActivityTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "activitysmith",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Official ActivitySmith Node.js SDK",
5
5
  "keywords": [
6
6
  "activitysmith",