@doist/comms-sdk 3.4.0 → 3.5.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.
@@ -49,6 +49,10 @@ export const AttachmentSchema = z.object(attachmentShape).loose();
49
49
  // this strips unknown keys so caller typos / off-spec fields are dropped instead
50
50
  // of being forwarded on the wire. Use this for `*Args` request schemas.
51
51
  export const RequestAttachmentSchema = z.object(attachmentShape);
52
+ // Clients that don't model `scope` can store `{}`, and the backend omits unset fields.
53
+ export const StatusEffectSchema = z.object({
54
+ scope: z.object({ mode: z.string().optional() }).optional(),
55
+ });
52
56
  // Shared user status. It lives on the Todoist account, so Comms, Todoist and
53
57
  // automations all see the same one. `activeUntil` is an RFC 3339 string, and an
54
58
  // expired status is returned as `null` rather than as an expired object.
@@ -58,7 +62,8 @@ export const UserStatusSchema = z.object({
58
62
  activeUntil: z.string().nullable().optional(),
59
63
  effects: z
60
64
  .object({
61
- pauseNotifications: z.object({ scope: z.object({ mode: z.string() }) }).optional(),
65
+ pauseNotifications: StatusEffectSchema.optional(),
66
+ pauseActivity: StatusEffectSchema.optional(),
62
67
  })
63
68
  .optional(),
64
69
  });
@@ -54,15 +54,25 @@ export declare const RequestAttachmentSchema: z.ZodObject<{
54
54
  videoAutoPlay: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
55
55
  }, z.core.$strip>;
56
56
  export type RequestAttachment = z.infer<typeof RequestAttachmentSchema>;
57
+ export declare const StatusEffectSchema: z.ZodObject<{
58
+ scope: z.ZodOptional<z.ZodObject<{
59
+ mode: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>>;
61
+ }, z.core.$strip>;
57
62
  export declare const UserStatusSchema: z.ZodObject<{
58
63
  message: z.ZodString;
59
64
  emoji: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
65
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
61
66
  effects: z.ZodOptional<z.ZodObject<{
62
67
  pauseNotifications: z.ZodOptional<z.ZodObject<{
63
- scope: z.ZodObject<{
64
- mode: z.ZodString;
65
- }, z.core.$strip>;
68
+ scope: z.ZodOptional<z.ZodObject<{
69
+ mode: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>>;
72
+ pauseActivity: z.ZodOptional<z.ZodObject<{
73
+ scope: z.ZodOptional<z.ZodObject<{
74
+ mode: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strip>>;
66
76
  }, z.core.$strip>>;
67
77
  }, z.core.$strip>>;
68
78
  }, z.core.$strip>;
@@ -89,9 +99,14 @@ export declare const BaseUserSchema: z.ZodObject<{
89
99
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
100
  effects: z.ZodOptional<z.ZodObject<{
91
101
  pauseNotifications: z.ZodOptional<z.ZodObject<{
92
- scope: z.ZodObject<{
93
- mode: z.ZodString;
94
- }, z.core.$strip>;
102
+ scope: z.ZodOptional<z.ZodObject<{
103
+ mode: z.ZodOptional<z.ZodString>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>>;
106
+ pauseActivity: z.ZodOptional<z.ZodObject<{
107
+ scope: z.ZodOptional<z.ZodObject<{
108
+ mode: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strip>>;
95
110
  }, z.core.$strip>>;
96
111
  }, z.core.$strip>>;
97
112
  }, z.core.$strip>>>;
@@ -118,9 +133,14 @@ export declare const UserSchema: z.ZodObject<{
118
133
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
134
  effects: z.ZodOptional<z.ZodObject<{
120
135
  pauseNotifications: z.ZodOptional<z.ZodObject<{
121
- scope: z.ZodObject<{
122
- mode: z.ZodString;
123
- }, z.core.$strip>;
136
+ scope: z.ZodOptional<z.ZodObject<{
137
+ mode: z.ZodOptional<z.ZodString>;
138
+ }, z.core.$strip>>;
139
+ }, z.core.$strip>>;
140
+ pauseActivity: z.ZodOptional<z.ZodObject<{
141
+ scope: z.ZodOptional<z.ZodObject<{
142
+ mode: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>>;
124
144
  }, z.core.$strip>>;
125
145
  }, z.core.$strip>>;
126
146
  }, z.core.$strip>>>;
@@ -1634,9 +1654,14 @@ export declare const WorkspaceUserSchema: z.ZodObject<{
1634
1654
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1635
1655
  effects: z.ZodOptional<z.ZodObject<{
1636
1656
  pauseNotifications: z.ZodOptional<z.ZodObject<{
1637
- scope: z.ZodObject<{
1638
- mode: z.ZodString;
1639
- }, z.core.$strip>;
1657
+ scope: z.ZodOptional<z.ZodObject<{
1658
+ mode: z.ZodOptional<z.ZodString>;
1659
+ }, z.core.$strip>>;
1660
+ }, z.core.$strip>>;
1661
+ pauseActivity: z.ZodOptional<z.ZodObject<{
1662
+ scope: z.ZodOptional<z.ZodObject<{
1663
+ mode: z.ZodOptional<z.ZodString>;
1664
+ }, z.core.$strip>>;
1640
1665
  }, z.core.$strip>>;
1641
1666
  }, z.core.$strip>>;
1642
1667
  }, z.core.$strip>>>;
@@ -1659,9 +1684,14 @@ export declare const RestrictedWorkspaceUserSchema: z.ZodObject<{
1659
1684
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1660
1685
  effects: z.ZodOptional<z.ZodObject<{
1661
1686
  pauseNotifications: z.ZodOptional<z.ZodObject<{
1662
- scope: z.ZodObject<{
1663
- mode: z.ZodString;
1664
- }, z.core.$strip>;
1687
+ scope: z.ZodOptional<z.ZodObject<{
1688
+ mode: z.ZodOptional<z.ZodString>;
1689
+ }, z.core.$strip>>;
1690
+ }, z.core.$strip>>;
1691
+ pauseActivity: z.ZodOptional<z.ZodObject<{
1692
+ scope: z.ZodOptional<z.ZodObject<{
1693
+ mode: z.ZodOptional<z.ZodString>;
1694
+ }, z.core.$strip>>;
1665
1695
  }, z.core.$strip>>;
1666
1696
  }, z.core.$strip>>;
1667
1697
  }, z.core.$strip>>>;
@@ -1704,9 +1734,14 @@ export declare const VisibleWorkspaceUserSchema: z.ZodUnion<readonly [z.ZodObjec
1704
1734
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1705
1735
  effects: z.ZodOptional<z.ZodObject<{
1706
1736
  pauseNotifications: z.ZodOptional<z.ZodObject<{
1707
- scope: z.ZodObject<{
1708
- mode: z.ZodString;
1709
- }, z.core.$strip>;
1737
+ scope: z.ZodOptional<z.ZodObject<{
1738
+ mode: z.ZodOptional<z.ZodString>;
1739
+ }, z.core.$strip>>;
1740
+ }, z.core.$strip>>;
1741
+ pauseActivity: z.ZodOptional<z.ZodObject<{
1742
+ scope: z.ZodOptional<z.ZodObject<{
1743
+ mode: z.ZodOptional<z.ZodString>;
1744
+ }, z.core.$strip>>;
1710
1745
  }, z.core.$strip>>;
1711
1746
  }, z.core.$strip>>;
1712
1747
  }, z.core.$strip>>>;
@@ -1727,9 +1762,14 @@ export declare const VisibleWorkspaceUserSchema: z.ZodUnion<readonly [z.ZodObjec
1727
1762
  activeUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1728
1763
  effects: z.ZodOptional<z.ZodObject<{
1729
1764
  pauseNotifications: z.ZodOptional<z.ZodObject<{
1730
- scope: z.ZodObject<{
1731
- mode: z.ZodString;
1732
- }, z.core.$strip>;
1765
+ scope: z.ZodOptional<z.ZodObject<{
1766
+ mode: z.ZodOptional<z.ZodString>;
1767
+ }, z.core.$strip>>;
1768
+ }, z.core.$strip>>;
1769
+ pauseActivity: z.ZodOptional<z.ZodObject<{
1770
+ scope: z.ZodOptional<z.ZodObject<{
1771
+ mode: z.ZodOptional<z.ZodString>;
1772
+ }, z.core.$strip>>;
1733
1773
  }, z.core.$strip>>;
1734
1774
  }, z.core.$strip>>;
1735
1775
  }, z.core.$strip>>>;
@@ -185,6 +185,11 @@ export type UpdateUserArgs = {
185
185
  /** Theme ID (0-12). String aliases like `'dark'` are also accepted. */
186
186
  theme?: number | string;
187
187
  };
188
+ type StatusEffectArgs = {
189
+ scope?: {
190
+ mode: 'all';
191
+ };
192
+ };
188
193
  export type SetStatusArgs = {
189
194
  /** 1 to 80 characters once trimmed. */
190
195
  message: string;
@@ -193,11 +198,9 @@ export type SetStatusArgs = {
193
198
  activeUntil?: Date | string | null;
194
199
  effects?: {
195
200
  /** Holds back Comms notifications while the status is active. They are not sent later. */
196
- pauseNotifications?: {
197
- scope?: {
198
- mode: 'all';
199
- };
200
- };
201
+ pauseNotifications?: StatusEffectArgs;
202
+ /** Meant to pause Karma and streaks while the status is active. Comms drops it until Doist/comms-backend#1081 ships. */
203
+ pauseActivity?: StatusEffectArgs;
201
204
  };
202
205
  };
203
206
  type SearchArgsCommon = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/comms-sdk",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
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/",