From 9ac5a15f2a22067efc354d9d96813694f707e191 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Sun, 20 Sep 2026 05:20:21 +0000 Subject: [PATCH 1/2] chore: regenerate SDK --- generated/apis/LiveActivitiesApi.ts | 20 +++--- generated/apis/MetricsApi.ts | 4 +- generated/models/index.ts | 102 +++++++++++++++++----------- generated/openapi-source.json | 4 +- 4 files changed, 78 insertions(+), 52 deletions(-) diff --git a/generated/apis/LiveActivitiesApi.ts b/generated/apis/LiveActivitiesApi.ts index 534f7d6..21830d7 100644 --- a/generated/apis/LiveActivitiesApi.ts +++ b/generated/apis/LiveActivitiesApi.ts @@ -61,7 +61,7 @@ export interface UpdateLiveActivityRequest { export class LiveActivitiesApi extends runtime.BaseAPI { /** - * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. * End a Live Activity (legacy manual lifecycle) */ async endLiveActivityRaw(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -98,7 +98,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + * Legacy manual lifecycle endpoint. For new integrations, use DELETE /live-activity/stream/{stream_key} to end a managed Live Activity stream. This endpoint remains supported for existing integrations and advanced lifecycle control. Ends a Live Activity and archives its lifecycle. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can send the latest number_of_steps here if the workflow changed after start. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. * End a Live Activity (legacy manual lifecycle) */ async endLiveActivity(requestParameters: EndLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -107,7 +107,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. * End a stream */ async endLiveActivityStreamRaw(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -144,7 +144,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + * Use this endpoint when the process you are tracking is finished and you no longer want the Live Activity on your devices. ActivitySmith ends the current Live Activity for this stream and dismisses it from devices. If you need direct lifecycle control, use /live-activity/start, /live-activity/update, and /live-activity/end instead. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. * End a stream */ async endLiveActivityStream(requestParameters: EndLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -153,7 +153,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. * Start a new Live Activity or update an existing one */ async reconcileLiveActivityStreamRaw(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -197,7 +197,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. + * Use a stable stream_key for each ongoing thing you want to show as a Live Activity. Send the latest content_state whenever it changes, and ActivitySmith will keep the Live Activity in sync. For timer streams, send duration_seconds to start or reset the timer; omit duration_seconds on later updates to preserve the existing timer window. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. On later stream updates, omit tags to keep the current tags, send tags again to replace them, or send an empty array to clear them. * Start a new Live Activity or update an existing one */ async reconcileLiveActivityStream(requestParameters: ReconcileLiveActivityStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -206,7 +206,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. + * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. * Start a Live Activity (legacy manual lifecycle) */ async startLiveActivityRaw(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -243,7 +243,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. Optional tags to organize and filter notification history. + * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Starts a Live Activity on devices matched by API key scope and optional target channels. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, number_of_steps can be changed later during update or end calls if the workflow changes. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. Optional tags to organize and filter notification history. * Start a Live Activity (legacy manual lifecycle) */ async startLiveActivity(requestParameters: StartLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { @@ -252,7 +252,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. * Update a Live Activity (legacy manual lifecycle) */ async updateLiveActivityRaw(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -289,7 +289,7 @@ export class LiveActivitiesApi extends runtime.BaseAPI { } /** - * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, and timer activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, and segmented_progress Live Activities. + * Legacy manual lifecycle endpoint. For new integrations, use PUT /live-activity/stream/{stream_key} so ActivitySmith can manage start, update, rotation, and end state for you. This endpoint remains supported for existing integrations and advanced lifecycle control. Updates an existing Live Activity. If the per-activity token is not registered yet, the update is queued. Supports segmented_progress, progress, metrics, stats, alert, timer, and value activity types. For segmented_progress activities, you can increase or decrease number_of_steps here as the workflow changes. For timer activities, send duration_seconds only when you want to reset the timer window; omit it to keep the current timer running. Use secondary_action for a second button on alert, progress, segmented_progress, and value Live Activities. * Update a Live Activity (legacy manual lifecycle) */ async updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/generated/apis/MetricsApi.ts b/generated/apis/MetricsApi.ts index 73924c6..05cc1b7 100644 --- a/generated/apis/MetricsApi.ts +++ b/generated/apis/MetricsApi.ts @@ -32,7 +32,7 @@ export interface UpdateMetricValueRequest { export class MetricsApi extends runtime.BaseAPI { /** - * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. + * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances. * Update a widget metric value */ async updateMetricValueRaw(requestParameters: UpdateMetricValueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -76,7 +76,7 @@ export class MetricsApi extends runtime.BaseAPI { } /** - * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. + * Updates the latest value for a metric displayed in ActivitySmith widgets. Create the metric in the web app first, then update its value using the key. Metric updates have an independent 300-requests-per-minute account allowance. They do not consume the Push Notification, badge, or Live Activity allowances. * Update a widget metric value */ async updateMetricValue(requestParameters: UpdateMetricValueRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/generated/models/index.ts b/generated/models/index.ts index 035a9f2..9eb0189 100644 --- a/generated/models/index.ts +++ b/generated/models/index.ts @@ -257,7 +257,7 @@ export interface ChannelTarget { channels: Array; } /** - * End payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. + * 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 value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve and freeze the latest timer state. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when ending an existing activity. You can send an updated number_of_steps here if the workflow changed after start. * @export * @interface ContentStateEnd */ @@ -293,11 +293,11 @@ export interface ContentStateEnd { */ percentage?: number; /** - * Current progress value. Use with upper_limit for type=progress. - * @type {number} + * For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. + * @type {LiveActivityValue} * @memberof ContentStateEnd */ - value?: number; + value?: LiveActivityValue; /** * Maximum progress value. Use with value for type=progress. * @type {number} @@ -335,13 +335,13 @@ export interface ContentStateEnd { */ message?: string; /** - * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. + * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. * @type {LiveActivityAlertIcon} * @memberof ContentStateEnd */ icon?: LiveActivityAlertIcon; /** - * Optional badge. Supported by alert, progress, and segmented_progress. + * Optional badge. Supported by alert, progress, segmented_progress, and value. * @type {LiveActivityAlertBadge} * @memberof ContentStateEnd */ @@ -353,7 +353,7 @@ export interface ContentStateEnd { */ type?: ContentStateEndTypeEnum; /** - * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. + * Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. * @type {string} * @memberof ContentStateEnd */ @@ -388,7 +388,8 @@ export const ContentStateEndTypeEnum = { Metrics: 'metrics', Stats: 'stats', Alert: 'alert', - Timer: 'timer' + Timer: 'timer', + Value: 'value' } as const; export type ContentStateEndTypeEnum = typeof ContentStateEndTypeEnum[keyof typeof ContentStateEndTypeEnum]; @@ -444,7 +445,7 @@ export const ContentStateEndStepColorsEnum = { export type ContentStateEndStepColorsEnum = typeof ContentStateEndStepColorsEnum[keyof typeof ContentStateEndStepColorsEnum]; /** - * Start payload requires title and type. For segmented_progress include number_of_steps and current_step. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. + * 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 value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer include duration_seconds for countdowns, or set counts_down false without duration_seconds for an open-ended elapsed timer. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. For segmented_progress, number_of_steps is not locked and can be changed in later update or end calls. * @export * @interface ContentStateStart */ @@ -480,11 +481,11 @@ export interface ContentStateStart { */ percentage?: number; /** - * Current progress value. Use with upper_limit for type=progress. - * @type {number} + * For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. + * @type {LiveActivityValue} * @memberof ContentStateStart */ - value?: number; + value?: LiveActivityValue; /** * Maximum progress value. Use with value for type=progress. * @type {number} @@ -522,13 +523,13 @@ export interface ContentStateStart { */ message?: string; /** - * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. + * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. * @type {LiveActivityAlertIcon} * @memberof ContentStateStart */ icon?: LiveActivityAlertIcon; /** - * Optional badge. Supported by alert, progress, and segmented_progress. + * Optional badge. Supported by alert, progress, segmented_progress, and value. * @type {LiveActivityAlertBadge} * @memberof ContentStateStart */ @@ -540,7 +541,7 @@ export interface ContentStateStart { */ type: ContentStateStartTypeEnum; /** - * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. + * Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. * @type {string} * @memberof ContentStateStart */ @@ -569,7 +570,8 @@ export const ContentStateStartTypeEnum = { Metrics: 'metrics', Stats: 'stats', Alert: 'alert', - Timer: 'timer' + Timer: 'timer', + Value: 'value' } as const; export type ContentStateStartTypeEnum = typeof ContentStateStartTypeEnum[keyof typeof ContentStateStartTypeEnum]; @@ -625,7 +627,7 @@ export const ContentStateStartStepColorsEnum = { export type ContentStateStartStepColorsEnum = typeof ContentStateStartStepColorsEnum[keyof typeof ContentStateStartStepColorsEnum]; /** - * Update payload requires title. For segmented_progress include current_step and optionally number_of_steps. For progress include percentage or value with upper_limit. For metrics and stats include a non-empty metrics array. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, and segmented_progress. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. + * 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 value include a string or number in value; strings preserve currency, units, and other formatting. For alert include message. For timer, omit duration_seconds to preserve the current timer window or send duration_seconds to reset the timer from the update request time. Optional icon is supported by all Live Activity types. Optional badge is supported by alert, progress, segmented_progress, and value. Type is optional when updating an existing activity. You can increase or decrease number_of_steps during updates. * @export * @interface ContentStateUpdate */ @@ -661,11 +663,11 @@ export interface ContentStateUpdate { */ percentage?: number; /** - * Current progress value. Use with upper_limit for type=progress. - * @type {number} + * For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For type=progress, a numeric progress value used with upper_limit. + * @type {LiveActivityValue} * @memberof ContentStateUpdate */ - value?: number; + value?: LiveActivityValue; /** * Maximum progress value. Use with value for type=progress. * @type {number} @@ -703,13 +705,13 @@ export interface ContentStateUpdate { */ message?: string; /** - * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. + * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. * @type {LiveActivityAlertIcon} * @memberof ContentStateUpdate */ icon?: LiveActivityAlertIcon; /** - * Optional badge. Supported by alert, progress, and segmented_progress. + * Optional badge. Supported by alert, progress, segmented_progress, and value. * @type {LiveActivityAlertBadge} * @memberof ContentStateUpdate */ @@ -721,7 +723,7 @@ export interface ContentStateUpdate { */ type?: ContentStateUpdateTypeEnum; /** - * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. + * Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. * @type {string} * @memberof ContentStateUpdate */ @@ -750,7 +752,8 @@ export const ContentStateUpdateTypeEnum = { Metrics: 'metrics', Stats: 'stats', Alert: 'alert', - Timer: 'timer' + Timer: 'timer', + Value: 'value' } as const; export type ContentStateUpdateTypeEnum = typeof ContentStateUpdateTypeEnum[keyof typeof ContentStateUpdateTypeEnum]; @@ -825,7 +828,7 @@ export interface ForbiddenError { message: string; } /** - * Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, and segmented_progress Live Activities. + * Optional action button shown in the Live Activity UI. Use action for the primary button, or secondary_action for a secondary button on alert, progress, segmented_progress, and value Live Activities. * @export * @interface LiveActivityAction */ @@ -967,7 +970,7 @@ export interface LiveActivityEndRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. + * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityEndRequest */ @@ -1078,7 +1081,7 @@ export interface LiveActivityStartRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. + * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityStartRequest */ @@ -1182,7 +1185,7 @@ export interface LiveActivityStreamDeleteRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. + * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityStreamDeleteRequest */ @@ -1365,7 +1368,7 @@ export interface LiveActivityStreamRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. + * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityStreamRequest */ @@ -1432,7 +1435,7 @@ export interface LiveActivityUpdateRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported for alert, progress, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. + * Optional secondary action button. Supported for alert, progress, segmented_progress, and value Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityUpdateRequest */ @@ -1475,6 +1478,12 @@ export interface LiveActivityUpdateResponse { */ timestamp: string; } +/** + * @type LiveActivityValue + * A formatted string or finite numeric Live Activity value. String formatting is preserved. + * @export + */ +export type LiveActivityValue = number | string; /** * @@ -1782,6 +1791,12 @@ export type PushNotificationWebhookMethod = typeof PushNotificationWebhookMethod * @interface RateLimitError */ export interface RateLimitError { + /** + * + * @type {string} + * @memberof RateLimitError + */ + code?: RateLimitErrorCodeEnum; /** * * @type {string} @@ -1795,6 +1810,16 @@ export interface RateLimitError { */ message: string; } + + +/** + * @export + */ +export const RateLimitErrorCodeEnum = { + RateLimited: 'rate_limited' +} as const; +export type RateLimitErrorCodeEnum = typeof RateLimitErrorCodeEnum[keyof typeof RateLimitErrorCodeEnum]; + /** * @type SendPushNotification429Response * @@ -1802,7 +1827,7 @@ export interface RateLimitError { */ export type SendPushNotification429Response = LiveActivityLimitError | RateLimitError; /** - * Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, and timer types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. + * Current state for a managed Live Activity stream. Include type on the first PUT, and whenever the stream may need to start a fresh activity. Supports segmented_progress, progress, metrics, stats, alert, timer, and value types. For timer, send duration_seconds to start or reset a bounded timer; omit duration_seconds on later updates to preserve the existing timer window. * @export * @interface StreamContentState */ @@ -1838,11 +1863,11 @@ export interface StreamContentState { */ percentage?: number; /** - * Current progress value. Use with upper_limit for progress. - * @type {number} + * For type=value, the required prominent readout (string or finite number); strings preserve exact formatting. For progress, a numeric progress value used with upper_limit. + * @type {LiveActivityValue} * @memberof StreamContentState */ - value?: number; + value?: LiveActivityValue; /** * Maximum progress value. Use with value for progress. * @type {number} @@ -1874,7 +1899,7 @@ export interface StreamContentState { */ type?: StreamContentStateTypeEnum; /** - * Optional. Accent color for progress, segmented_progress, metrics, and timer Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. + * Optional. Accent color for progress, segmented_progress, metrics, timer, and value Live Activities. For Alert Live Activities, this tints action and secondary_action buttons when included. * @type {string} * @memberof StreamContentState */ @@ -1904,13 +1929,13 @@ export interface StreamContentState { */ message?: string; /** - * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, and timer. + * Optional SF Symbol icon. Supported by alert, progress, segmented_progress, metrics, stats, timer, and value. * @type {LiveActivityAlertIcon} * @memberof StreamContentState */ icon?: LiveActivityAlertIcon; /** - * Optional badge. Supported by alert, progress, and segmented_progress. + * Optional badge. Supported by alert, progress, segmented_progress, and value. * @type {LiveActivityAlertBadge} * @memberof StreamContentState */ @@ -1939,7 +1964,8 @@ export const StreamContentStateTypeEnum = { Metrics: 'metrics', Stats: 'stats', Alert: 'alert', - Timer: 'timer' + Timer: 'timer', + Value: 'value' } as const; export type StreamContentStateTypeEnum = typeof StreamContentStateTypeEnum[keyof typeof StreamContentStateTypeEnum]; diff --git a/generated/openapi-source.json b/generated/openapi-source.json index dc05717..aeeecd6 100644 --- a/generated/openapi-source.json +++ b/generated/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "49ad7b083b50f53bc3d81edb77ca6597845160a2", + "commit": "6832df646de7de8a6aaf0110960c37074b513c48", "path": "openapi.json", - "sha256": "b7e33cd485df8ddc5d7fb7b57b61106fd6f8ff3ffa7cc7bef4ac1ccbbb0cede7" + "sha256": "9ae85ad6127cfa2d50c33261459f5f9e85e011939d01ac4a9d507fa6ed11aa61" } From 5b9e4da1b441ff15147b9a366dd0766990719a69 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sun, 20 Sep 2026 12:23:04 +0700 Subject: [PATCH 2/2] feat: add Value Live Activities in v1.12.0 --- CHANGELOG.md | 4 +++ README.md | 81 +++++++++++++++++++++++++------------------- package-lock.json | 4 +-- package.json | 2 +- src/ActivitySmith.ts | 4 ++- tests/value.test.js | 23 +++++++++++++ 6 files changed, 80 insertions(+), 38 deletions(-) create mode 100644 tests/value.test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index d6bf11e..8e9a429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.12.0 + +Adds the new `value` Live Activity type. + ## 1.11.0 This version adds support for Metadata and iOS deep links, and expands Tags support when updating or ending Live Activities. diff --git a/README.md b/README.md index 560ad77..b4f021d 100644 --- a/README.md +++ b/README.md @@ -132,33 +132,42 @@ await activitysmith.notifications.send({ Choose the Live Activity type that matches what you want to show: -![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) +- ![Value Live Activity showing revenue with a growth badge](https://cdn.activitysmith.com/features/value-live-activity.png) **Value**: Show a single value on your Lock Screen, such as revenue, a queue count, or a temperature. -**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. +- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. -![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) +- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. -**Metrics**: Track two related values with segmented bars, such as CPU and memory. +- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory. -![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) +- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. -**Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. +- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion. -![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) +- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs. -**Progress**: Show percentage progress for jobs that move continuously toward completion. - -![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) +### Start & Update Live Activity -**Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. +Use a stable `streamKey` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `streamKey` update it. -![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) +#### Value -**Timer**: Count down from a duration, or count up from 00:00 while a job runs. +![Value Live Activity stream example](https://cdn.activitysmith.com/features/value-live-activity.png) -### Start & Update Live Activity +```ts +await activitysmith.liveActivities.stream("revenue-today", { + content_state: ActivitySmith.contentState({ + title: "Revenue", + type: "value", + value: "$1,240", + color: "green", + icon: ActivitySmith.alertIcon("dollarsign.circle", { color: "green" }), + badge: ActivitySmith.alertBadge("↑ 18%", { color: "purple" }), + }), +}); +``` -Use a stable `streamKey` to identify the metric, job, deployment, or system you want to keep visible. The first `stream(...)` call starts the Live Activity. Later calls with the same `streamKey` update it. +Send a string or number in `value`. Strings keep their formatting, including currency symbols, units, and decimal places. #### Stats @@ -182,6 +191,22 @@ await activitysmith.liveActivities.stream("sales-hourly", { }); ``` +#### Alert + +![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png) + +```ts +await activitysmith.liveActivities.stream("customer-ops", { + content_state: ActivitySmith.contentState({ + title: "Reactivation", + message: "Lumen came back after 2 weeks", + type: "alert", + icon: ActivitySmith.alertIcon("cloud.sun", { color: "yellow" }), + badge: ActivitySmith.alertBadge("Customer", { color: "magenta" }), + }), +}); +``` + #### Metrics ![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) @@ -231,22 +256,6 @@ await activitysmith.liveActivities.stream("search-reindex", { }); ``` -#### Alert - -![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png) - -```ts -await activitysmith.liveActivities.stream("customer-ops", { - content_state: ActivitySmith.contentState({ - title: "Reactivation", - message: "Lumen came back after 2 weeks", - type: "alert", - icon: ActivitySmith.alertIcon("cloud.sun", { color: "yellow" }), - badge: ActivitySmith.alertBadge("Customer", { color: "magenta" }), - }), -}); -``` - #### Timer ![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png) @@ -292,7 +301,7 @@ Add more context to Live Activities with icons and badges. #### Icon -Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`. +Supported Live Activity types: `value`, `stats`, `alert`, `metrics`, `segmented_progress`, `progress`, and `timer`. ![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png) @@ -319,7 +328,7 @@ The `icon.symbol` value is an Apple SF Symbol name. Browse the catalog with one #### Badge -Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities. +Badges are supported by `value`, `alert`, `segmented_progress`, and `progress` Live Activities. ![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png) @@ -427,7 +436,7 @@ await activitysmith.liveActivities.stream("search-reindex", { Use `secondary_action` when you want a second button beside the primary `action`. -The secondary action button is supported for `alert`, `progress`, and `segmented_progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes. +The secondary action button is supported for `value`, `alert`, `segmented_progress`, and `progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes. ```ts await activitysmith.liveActivities.stream("agent-approval", { @@ -604,3 +613,7 @@ try { ### [NPM Package](https://www.npmjs.com/package/activitysmith) Install the ActivitySmith Node.js SDK from npm + +### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-node) + +View the Node.js SDK source on GitHub diff --git a/package-lock.json b/package-lock.json index d5b632c..4988304 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "activitysmith", - "version": "1.11.0", + "version": "1.12.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "activitysmith", - "version": "1.11.0", + "version": "1.12.0", "license": "MIT", "devDependencies": { "typescript": "^5.3.3", diff --git a/package.json b/package.json index d0b2e27..9f91ddd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "activitysmith", - "version": "1.11.0", + "version": "1.12.0", "description": "Official ActivitySmith Node.js SDK", "keywords": [ "activitysmith", diff --git a/src/ActivitySmith.ts b/src/ActivitySmith.ts index ab7a7d0..abe787c 100644 --- a/src/ActivitySmith.ts +++ b/src/ActivitySmith.ts @@ -6,7 +6,7 @@ import { PushNotificationsApi, } from "../generated/index"; -const SDK_VERSION = "1.11.0"; +const SDK_VERSION = "1.12.0"; const SDK_HEADER_NAME = "X-ActivitySmith-SDK"; const DEFAULT_SDK_NAME = "node"; const SDK_HEADER_VALUE = `${DEFAULT_SDK_NAME}-v${SDK_VERSION}`; @@ -54,6 +54,7 @@ const LiveActivityTypes = { stats: "stats", alert: "alert", timer: "timer", + value: "value", } as const; export type LiveActivityType = (typeof LiveActivityTypes)[keyof typeof LiveActivityTypes]; @@ -73,6 +74,7 @@ export type LiveActivityContentState = Record & { subtitle?: string; type?: LiveActivityType | string; message?: string; + value?: string | number; icon?: LiveActivityAlertIcon; badge?: LiveActivityAlertBadge; color?: string; diff --git a/tests/value.test.js b/tests/value.test.js new file mode 100644 index 0000000..9e38f13 --- /dev/null +++ b/tests/value.test.js @@ -0,0 +1,23 @@ +import { createRequire } from 'node:module'; +import { afterEach, expect, it, vi } from 'vitest'; +const require = createRequire(import.meta.url); +const ActivitySmith = require('../dist/src/index.js'); +afterEach(() => vi.unstubAllGlobals()); +for (const method of ['start', 'update', 'end', 'stream', 'endStream']) { + it(`${method} sends formatted Value strings and zero through the real serializer`, async () => { + const bodies = []; + vi.stubGlobal('fetch', vi.fn(async (_url, init) => { + bodies.push(JSON.parse(init.body)); + return new Response(JSON.stringify({success: true}), {status: 200}); + })); + const activitysmith = new ActivitySmith({apiKey: 'test'}); + for (const value of ['$1,240', '0007', '', 0, -12.75]) { + const request = {content_state: ActivitySmith.contentState({title: 'Revenue', type: ActivitySmith.liveActivityTypes.value, value})}; + if (['update', 'end'].includes(method)) request.activity_id = 'test'; + const args = ['stream', 'endStream'].includes(method) ? ['revenue', request] : [request]; + await activitysmith.liveActivities[method](...args); + expect(bodies.at(-1).content_state.value).toBe(value); + expect(bodies.at(-1).content_state.type).toBe('value'); + } + }); +}