@doist/comms-sdk 3.9.0 → 3.9.1

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.
@@ -164,16 +164,16 @@ export class UsersClient extends BaseClient {
164
164
  return this.post(`${ENDPOINT_USERS}/update`, args, UserSchema);
165
165
  }
166
166
  /**
167
- * Sets the shared status of the session user, replacing any current one.
167
+ * Creates or partially updates the session user's shared status.
168
168
  * The status belongs to the Todoist account, so it is shared with Todoist.
169
169
  * Requires the `user:write` scope.
170
170
  *
171
171
  * @param args - The status to set.
172
- * @param args.message - 1 to 80 characters once trimmed.
173
- * @param args.emoji - Optional emoji.
174
- * @param args.activeUntil - Optional expiry in the future (`Date` or ISO 8601 string).
175
- * @param args.effects - Optional effects, e.g. `{ pauseNotifications: {} }` to hold back
176
- * Comms notifications while the status is active.
172
+ * @param args.message - 1 to 80 characters once trimmed. Required when creating a status.
173
+ * @param args.emoji - Emoji to set; null removes it, omission preserves it.
174
+ * @param args.activeUntil - Future expiry (`Date` or ISO string); null removes it, omission preserves it.
175
+ * @param args.effects - Merge supplied effects. Omission or {} preserves effects; null clears all.
176
+ * An individual effect set to null is removed; {} preserves its configuration or enables defaults.
177
177
  * @returns The updated user object.
178
178
  *
179
179
  * @example
@@ -160,16 +160,16 @@ export declare class UsersClient extends BaseClient {
160
160
  */
161
161
  update(args: UpdateUserArgs): Promise<User>;
162
162
  /**
163
- * Sets the shared status of the session user, replacing any current one.
163
+ * Creates or partially updates the session user's shared status.
164
164
  * The status belongs to the Todoist account, so it is shared with Todoist.
165
165
  * Requires the `user:write` scope.
166
166
  *
167
167
  * @param args - The status to set.
168
- * @param args.message - 1 to 80 characters once trimmed.
169
- * @param args.emoji - Optional emoji.
170
- * @param args.activeUntil - Optional expiry in the future (`Date` or ISO 8601 string).
171
- * @param args.effects - Optional effects, e.g. `{ pauseNotifications: {} }` to hold back
172
- * Comms notifications while the status is active.
168
+ * @param args.message - 1 to 80 characters once trimmed. Required when creating a status.
169
+ * @param args.emoji - Emoji to set; null removes it, omission preserves it.
170
+ * @param args.activeUntil - Future expiry (`Date` or ISO string); null removes it, omission preserves it.
171
+ * @param args.effects - Merge supplied effects. Omission or {} preserves effects; null clears all.
172
+ * An individual effect set to null is removed; {} preserves its configuration or enables defaults.
173
173
  * @returns The updated user object.
174
174
  *
175
175
  * @example
@@ -189,21 +189,23 @@ export type UpdateUserArgs = {
189
189
  };
190
190
  type StatusEffectArgs = {
191
191
  scope?: {
192
- mode: 'all';
192
+ mode?: 'all';
193
193
  };
194
194
  };
195
+ /** Only supplied fields change. Null removes optional fields and effects. */
195
196
  export type SetStatusArgs = {
196
- /** 1 to 80 characters once trimmed. */
197
- message: string;
197
+ /** 1 to 80 characters once trimmed. Required when creating a status; omission preserves it. */
198
+ message?: string;
198
199
  emoji?: string | null;
199
- /** When the status ends. Must be in the future. A `Date` is sent as an ISO 8601 string. */
200
+ /** Must be in the future; null removes expiry, omission preserves it. Dates are sent as ISO strings. */
200
201
  activeUntil?: Date | string | null;
202
+ /** Supplied effects are merged; null clears all effects, omission or {} preserves them. */
201
203
  effects?: {
202
- /** Holds back Comms notifications while the status is active. They are not sent later. */
203
- pauseNotifications?: StatusEffectArgs;
204
- /** Meant to pause Karma and streaks while the status is active. Comms drops it until Doist/comms-backend#1081 ships. */
205
- pauseActivity?: StatusEffectArgs;
206
- };
204
+ /** Holds back Comms notifications. Null removes it; {} preserves its configuration or enables it with defaults. */
205
+ pauseNotifications?: StatusEffectArgs | null;
206
+ /** Pauses Todoist Karma and streaks. Null removes it; {} preserves its configuration or enables it with defaults. */
207
+ pauseActivity?: StatusEffectArgs | null;
208
+ } | null;
207
209
  };
208
210
  type SearchArgsCommon = {
209
211
  workspaceId: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/comms-sdk",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "A TypeScript wrapper for the Comms REST API.",
5
5
  "author": "Doist developers",
6
6
  "homepage": "https://doist.github.io/comms-sdk-typescript/",