From ff69b8e81ac7b59230368f79c0c9690d0b958942 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Sat, 25 Jul 2026 02:55:01 +0000 Subject: [PATCH 1/5] chore: regenerate SDK --- generated/apis/AppIconBadgesApi.ts | 8 ++-- generated/apis/LiveActivitiesApi.ts | 20 +++++----- generated/apis/PushNotificationsApi.ts | 4 +- generated/models/index.ts | 54 +++++++++++++++++++++----- 4 files changed, 61 insertions(+), 25 deletions(-) diff --git a/generated/apis/AppIconBadgesApi.ts b/generated/apis/AppIconBadgesApi.ts index f78cbe1..3346b05 100644 --- a/generated/apis/AppIconBadgesApi.ts +++ b/generated/apis/AppIconBadgesApi.ts @@ -33,8 +33,8 @@ export interface UpdateAppIconBadgeCountRequest { export class AppIconBadgesApi extends runtime.BaseAPI { /** - * Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item. - * Update App Icon Badge Count + * Shows a number on the ActivitySmith app icon. + * Set App Icon Badge Count */ async updateAppIconBadgeCountRaw(requestParameters: UpdateAppIconBadgeCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['appIconBadgeCountUpdateRequest'] == null) { @@ -70,8 +70,8 @@ export class AppIconBadgesApi extends runtime.BaseAPI { } /** - * Updates the App Icon Badge Count on devices matched by API key scope and optional target channels. Send `badge: 0` to clear the count. Badge updates are independent of push notifications and do not create a push notification history item. - * Update App Icon Badge Count + * Shows a number on the ActivitySmith app icon. + * Set App Icon Badge Count */ async updateAppIconBadgeCount(requestParameters: UpdateAppIconBadgeCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.updateAppIconBadgeCountRaw(requestParameters, initOverrides); diff --git a/generated/apis/LiveActivitiesApi.ts b/generated/apis/LiveActivitiesApi.ts index cb2d13e..534f7d6 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * 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 only. + * 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. * Update a Live Activity (legacy manual lifecycle) */ async updateLiveActivity(requestParameters: UpdateLiveActivityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/generated/apis/PushNotificationsApi.ts b/generated/apis/PushNotificationsApi.ts index c2d3666..6fb1252 100644 --- a/generated/apis/PushNotificationsApi.ts +++ b/generated/apis/PushNotificationsApi.ts @@ -33,7 +33,7 @@ export interface SendPushNotificationRequest { export class PushNotificationsApi extends runtime.BaseAPI { /** - * Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. + * Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history. * Send a push notification */ async sendPushNotificationRaw(requestParameters: SendPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { @@ -70,7 +70,7 @@ export class PushNotificationsApi extends runtime.BaseAPI { } /** - * Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. + * Sends a push notification to devices matched by API key scope and optional target channels. Supports optional redirection URL, optional media preview or playback when the notification is expanded, and up to 4 interactive actions. `media` cannot be combined with `actions`. Optional tags to organize and filter notification history. * Send a push notification */ async sendPushNotification(requestParameters: SendPushNotificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { diff --git a/generated/models/index.ts b/generated/models/index.ts index 3d12627..0572d22 100644 --- a/generated/models/index.ts +++ b/generated/models/index.ts @@ -76,7 +76,7 @@ export interface AlertPayload { body?: string; } /** - * App Icon Badge Count update. Send badge 0 to clear the count. + * * @export * @interface AppIconBadgeCountUpdateRequest */ @@ -757,7 +757,7 @@ export interface LiveActivityAction { */ type: LiveActivityActionType; /** - * Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. + * Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. * @type {string} * @memberof LiveActivityAction */ @@ -868,7 +868,7 @@ export interface LiveActivityEndRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported only 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, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityEndRequest */ @@ -961,7 +961,7 @@ export interface LiveActivityStartRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported only 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, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityStartRequest */ @@ -978,6 +978,12 @@ export interface LiveActivityStartRequest { * @memberof LiveActivityStartRequest */ target?: ChannelTarget; + /** + * Optional tags to organize and filter notification history. + * @type {Array} + * @memberof LiveActivityStartRequest + */ + tags?: Array; } /** * Returned after a Live Activity starts. Save activity_id and use it for all later updates and for the final end call. @@ -1015,6 +1021,12 @@ export interface LiveActivityStartResponse { * @memberof LiveActivityStartResponse */ effective_channel_slugs?: Array; + /** + * Optional tags to organize and filter notification history. + * @type {Array} + * @memberof LiveActivityStartResponse + */ + tags?: Array; /** * * @type {string} @@ -1041,7 +1053,7 @@ export interface LiveActivityStreamDeleteRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported only 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, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityStreamDeleteRequest */ @@ -1172,6 +1184,12 @@ export interface LiveActivityStreamPutResponse { * @memberof LiveActivityStreamPutResponse */ effective_channel_slugs?: Array; + /** + * Optional tags to organize and filter notification history. + * @type {Array} + * @memberof LiveActivityStreamPutResponse + */ + tags?: Array; /** * * @type {string} @@ -1212,7 +1230,7 @@ export interface LiveActivityStreamRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported only 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, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityStreamRequest */ @@ -1235,6 +1253,12 @@ export interface LiveActivityStreamRequest { * @memberof LiveActivityStreamRequest */ target?: ChannelTarget; + /** + * Optional tags to organize and filter notification history. + * @type {Array} + * @memberof LiveActivityStreamRequest + */ + tags?: Array; } /** * Update an existing Live Activity by activity_id. @@ -1261,7 +1285,7 @@ export interface LiveActivityUpdateRequest { */ action?: LiveActivityAction; /** - * Optional secondary action button. Supported only 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, and segmented_progress Live Activities. Uses the same open_url, shortcuts://, and webhook shapes as action. * @type {LiveActivityAction} * @memberof LiveActivityUpdateRequest */ @@ -1436,7 +1460,7 @@ export interface PushNotificationAction { */ type: PushNotificationActionType; /** - * Action URL. For open_url, use an HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. + * Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. * @type {string} * @memberof PushNotificationAction */ @@ -1497,7 +1521,7 @@ export interface PushNotificationRequest { */ media?: string; /** - * Optional HTTPS URL or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided. + * Optional HTTP URL, HTTPS URL, or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided. * @type {string} * @memberof PushNotificationRequest */ @@ -1532,6 +1556,12 @@ export interface PushNotificationRequest { * @memberof PushNotificationRequest */ target?: ChannelTarget; + /** + * Optional tags to organize and filter notification history. + * @type {Array} + * @memberof PushNotificationRequest + */ + tags?: Array; } /** * @@ -1563,6 +1593,12 @@ export interface PushNotificationResponse { * @memberof PushNotificationResponse */ effective_channel_slugs?: Array; + /** + * Optional tags to organize and filter notification history. + * @type {Array} + * @memberof PushNotificationResponse + */ + tags?: Array; /** * * @type {string} From c67e29d47bb9570c09c41c94725b93f40746ca85 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sat, 25 Jul 2026 10:11:10 +0700 Subject: [PATCH 2/5] feat: add tags to handwritten SDK helpers Why: - expose notification-history tags through the idiomatic SDK surface How: - accept tags for push sends, Live Activity starts, and streams - cover wrapper pass-through behavior with tests Verification: - npm test (28 tests) Spec: ActivitySmithHQ/docs@bf95a29 Initiated-by: user Implemented-by: codex --- src/ActivitySmith.ts | 7 +-- tests/resources.test.js | 94 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 3 deletions(-) diff --git a/src/ActivitySmith.ts b/src/ActivitySmith.ts index 1222797..cd42084 100644 --- a/src/ActivitySmith.ts +++ b/src/ActivitySmith.ts @@ -36,7 +36,8 @@ type AppIconBadgeRequestBody = Parameters[0]["appIconBadgeCountUpdateRequest"]; type AppIconBadgeInitOverrides = Parameters[1]; type ChannelTargetInput = { channels?: string[] }; -type PushSendRequest = PushRequestBody & { channels?: string[] }; +type HistoryTagsInput = { tags?: string[] }; +type PushSendRequest = PushRequestBody & { channels?: string[] } & HistoryTagsInput; export type BadgeCountOptions = { channels?: string[]; @@ -86,7 +87,7 @@ type LiveActivityAlertBadgeOptions = { type LiveStartSendRequest = Omit & { content_state: LiveActivityContentState; channels?: string[]; -}; +} & HistoryTagsInput; type LiveUpdateSendRequest = Omit & { content_state: LiveActivityContentState; }; @@ -96,7 +97,7 @@ type LiveEndSendRequest = Omit & { type LiveStreamSendRequest = Omit & { content_state: LiveActivityContentState; channels?: string[]; -}; +} & HistoryTagsInput; type LiveStreamDeleteSendRequest = Omit & { content_state?: LiveActivityContentState; }; diff --git a/tests/resources.test.js b/tests/resources.test.js index 87f1499..4899022 100644 --- a/tests/resources.test.js +++ b/tests/resources.test.js @@ -49,6 +49,31 @@ describe("resource wrappers", () => { ); }); + it("passes tags through notifications.send", async () => { + const ActivitySmith = require("../dist/src/index.js"); + const generated = require("../dist/generated/index.js"); + + const sendSpy = vi + .spyOn(generated.PushNotificationsApi.prototype, "sendPushNotification") + .mockResolvedValue({ success: true }); + + const client = new ActivitySmith({ apiKey: "test" }); + await client.notifications.send({ + title: "Build Failed", + tags: ["user:382", "environment:production"], + }); + + expect(sendSpy).toHaveBeenCalledWith( + { + pushNotificationRequest: { + title: "Build Failed", + tags: ["user:382", "environment:production"], + }, + }, + undefined, + ); + }); + it("preserves media and redirection for notifications.send", async () => { const ActivitySmith = require("../dist/src/index.js"); const generated = require("../dist/generated/index.js"); @@ -288,6 +313,41 @@ describe("resource wrappers", () => { ); }); + it("passes tags through liveActivities.start", async () => { + const ActivitySmith = require("../dist/src/index.js"); + const generated = require("../dist/generated/index.js"); + + const startSpy = vi + .spyOn(generated.LiveActivitiesApi.prototype, "startLiveActivity") + .mockResolvedValue({ activity_id: "act-1" }); + + const client = new ActivitySmith({ apiKey: "test" }); + await client.liveActivities.start({ + content_state: { + title: "Deploy", + number_of_steps: 4, + current_step: 1, + type: "segmented_progress", + }, + tags: ["user:382", "deployment"], + }); + + expect(startSpy).toHaveBeenCalledWith( + { + liveActivityStartRequest: { + content_state: { + title: "Deploy", + number_of_steps: 4, + current_step: 1, + type: "segmented_progress", + }, + tags: ["user:382", "deployment"], + }, + }, + undefined, + ); + }); + it("passes through progress content_state without segmented fields", async () => { const ActivitySmith = require("../dist/src/index.js"); const generated = require("../dist/generated/index.js"); @@ -521,6 +581,40 @@ describe("resource wrappers", () => { expect(endStreamSpy).toHaveBeenCalledWith({ streamKey: "prod-web-1" }, undefined); }); + it("passes tags through liveActivities.stream", async () => { + const ActivitySmith = require("../dist/src/index.js"); + const generated = require("../dist/generated/index.js"); + + const streamSpy = vi + .spyOn(generated.LiveActivitiesApi.prototype, "reconcileLiveActivityStream") + .mockResolvedValue({ operation: "started", stream_key: "prod-web-1" }); + + const client = new ActivitySmith({ apiKey: "test" }); + await client.liveActivities.stream("prod-web-1", { + content_state: { + title: "Server Health", + type: "metrics", + metrics: [{ label: "CPU", value: 9, unit: "%" }], + }, + tags: ["user:382", "environment:production"], + }); + + expect(streamSpy).toHaveBeenCalledWith( + { + streamKey: "prod-web-1", + liveActivityStreamRequest: { + content_state: { + title: "Server Health", + type: "metrics", + metrics: [{ label: "CPU", value: 9, unit: "%" }], + }, + tags: ["user:382", "environment:production"], + }, + }, + undefined, + ); + }); + it("keeps long stream aliases working", async () => { const ActivitySmith = require("../dist/src/index.js"); const generated = require("../dist/generated/index.js"); From fa574f974eed366208a6b250bcd15b7fb54fa9a9 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sat, 25 Jul 2026 10:30:21 +0700 Subject: [PATCH 3/5] refactor: rely on generated tag types Remove the redundant handwritten tag intersections. The regenerated OpenAPI request models already expose tags for push notifications, Live Activity starts, and streams. Verification: npm test (28 tests) Initiated-by: user Implemented-by: codex --- src/ActivitySmith.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ActivitySmith.ts b/src/ActivitySmith.ts index cd42084..1222797 100644 --- a/src/ActivitySmith.ts +++ b/src/ActivitySmith.ts @@ -36,8 +36,7 @@ type AppIconBadgeRequestBody = Parameters[0]["appIconBadgeCountUpdateRequest"]; type AppIconBadgeInitOverrides = Parameters[1]; type ChannelTargetInput = { channels?: string[] }; -type HistoryTagsInput = { tags?: string[] }; -type PushSendRequest = PushRequestBody & { channels?: string[] } & HistoryTagsInput; +type PushSendRequest = PushRequestBody & { channels?: string[] }; export type BadgeCountOptions = { channels?: string[]; @@ -87,7 +86,7 @@ type LiveActivityAlertBadgeOptions = { type LiveStartSendRequest = Omit & { content_state: LiveActivityContentState; channels?: string[]; -} & HistoryTagsInput; +}; type LiveUpdateSendRequest = Omit & { content_state: LiveActivityContentState; }; @@ -97,7 +96,7 @@ type LiveEndSendRequest = Omit & { type LiveStreamSendRequest = Omit & { content_state: LiveActivityContentState; channels?: string[]; -} & HistoryTagsInput; +}; type LiveStreamDeleteSendRequest = Omit & { content_state?: LiveActivityContentState; }; From 1a0511ec5c8dcad750599cdba02b1cca663b1ac4 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sat, 25 Jul 2026 10:41:25 +0700 Subject: [PATCH 4/5] docs: document notification tags Add the approved Tags section below Channels with a language-native multiple-tag example. Spec: ActivitySmithHQ/docs@bf95a29 Initiated-by: user Implemented-by: codex --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 7dc1631..7da79bb 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ See [API reference](https://activitysmith.com/docs/api-reference/introduction) - [Widgets](#widgets) - [App Icon Badge Count](#app-icon-badge-count) - [Channels](#channels) +- [Tags](#tags) ## Installation @@ -549,6 +550,18 @@ await activitysmith.badgeCount(3, { }); ``` +## Tags + +Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. + +```ts +await activitysmith.notifications.send({ + title: "New subscription 💸", + message: "Customer upgraded to Pro plan", + tags: ["user:382", "billing"], +}); +``` + ## Error Handling ```ts From 62a913692a0d4624f77a38b48e2f215ee8d5ccad Mon Sep 17 00:00:00 2001 From: bardonadam Date: Sat, 25 Jul 2026 10:52:45 +0700 Subject: [PATCH 5/5] chore: prepare 1.10.0 release Why: - release Tags as a new organization and filtering feature How: - bump package and runtime identification to 1.10.0 - add the approved outcome-oriented changelog entry Verification: - npm test (28 tests); npm pack --dry-run Spec: ActivitySmithHQ/docs@bf95a29 Initiated-by: user Implemented-by: codex --- CHANGELOG.md | 6 ++++++ package-lock.json | 4 ++-- package.json | 2 +- src/ActivitySmith.ts | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9485214..0118f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.10.0 + +### New Features + +- **New Feature: Tags** — Organize and filter your Push Notification and Live Activity history using one or more tags. + ## 1.9.0 ### New Features diff --git a/package-lock.json b/package-lock.json index 713333d..33d0408 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "activitysmith", - "version": "1.9.0", + "version": "1.10.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "activitysmith", - "version": "1.9.0", + "version": "1.10.0", "license": "MIT", "devDependencies": { "typescript": "^5.3.3", diff --git a/package.json b/package.json index 9a1241e..c69c536 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "activitysmith", - "version": "1.9.0", + "version": "1.10.0", "description": "Official ActivitySmith Node.js SDK", "keywords": [ "activitysmith", diff --git a/src/ActivitySmith.ts b/src/ActivitySmith.ts index 1222797..d262b48 100644 --- a/src/ActivitySmith.ts +++ b/src/ActivitySmith.ts @@ -6,7 +6,7 @@ import { PushNotificationsApi, } from "../generated/index"; -const SDK_VERSION = "1.9.0"; +const SDK_VERSION = "1.10.0"; const SDK_HEADER_NAME = "X-ActivitySmith-SDK"; const SDK_HEADER_VALUE = `node-v${SDK_VERSION}`;