@doist/comms-sdk 3.4.1 → 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,10 +62,8 @@ export const UserStatusSchema = z.object({
|
|
|
58
62
|
activeUntil: z.string().nullable().optional(),
|
|
59
63
|
effects: z
|
|
60
64
|
.object({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.object({ scope: z.object({ mode: z.string().optional() }).optional() })
|
|
64
|
-
.optional(),
|
|
65
|
+
pauseNotifications: StatusEffectSchema.optional(),
|
|
66
|
+
pauseActivity: StatusEffectSchema.optional(),
|
|
65
67
|
})
|
|
66
68
|
.optional(),
|
|
67
69
|
});
|
|
@@ -54,6 +54,11 @@ 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>>;
|
|
@@ -64,6 +69,11 @@ export declare const UserStatusSchema: z.ZodObject<{
|
|
|
64
69
|
mode: z.ZodOptional<z.ZodString>;
|
|
65
70
|
}, z.core.$strip>>;
|
|
66
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>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
67
77
|
}, z.core.$strip>>;
|
|
68
78
|
}, z.core.$strip>;
|
|
69
79
|
export type UserStatus = z.infer<typeof UserStatusSchema>;
|
|
@@ -93,6 +103,11 @@ export declare const BaseUserSchema: z.ZodObject<{
|
|
|
93
103
|
mode: z.ZodOptional<z.ZodString>;
|
|
94
104
|
}, z.core.$strip>>;
|
|
95
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>>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
96
111
|
}, z.core.$strip>>;
|
|
97
112
|
}, z.core.$strip>>>;
|
|
98
113
|
}, z.core.$strip>;
|
|
@@ -122,6 +137,11 @@ export declare const UserSchema: z.ZodObject<{
|
|
|
122
137
|
mode: z.ZodOptional<z.ZodString>;
|
|
123
138
|
}, z.core.$strip>>;
|
|
124
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>>;
|
|
144
|
+
}, z.core.$strip>>;
|
|
125
145
|
}, z.core.$strip>>;
|
|
126
146
|
}, z.core.$strip>>>;
|
|
127
147
|
email: z.ZodEmail;
|
|
@@ -1638,6 +1658,11 @@ export declare const WorkspaceUserSchema: z.ZodObject<{
|
|
|
1638
1658
|
mode: z.ZodOptional<z.ZodString>;
|
|
1639
1659
|
}, z.core.$strip>>;
|
|
1640
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>>;
|
|
1665
|
+
}, z.core.$strip>>;
|
|
1641
1666
|
}, z.core.$strip>>;
|
|
1642
1667
|
}, z.core.$strip>>>;
|
|
1643
1668
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1663,6 +1688,11 @@ export declare const RestrictedWorkspaceUserSchema: z.ZodObject<{
|
|
|
1663
1688
|
mode: z.ZodOptional<z.ZodString>;
|
|
1664
1689
|
}, z.core.$strip>>;
|
|
1665
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>>;
|
|
1695
|
+
}, z.core.$strip>>;
|
|
1666
1696
|
}, z.core.$strip>>;
|
|
1667
1697
|
}, z.core.$strip>>>;
|
|
1668
1698
|
id: z.ZodNumber;
|
|
@@ -1708,6 +1738,11 @@ export declare const VisibleWorkspaceUserSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
1708
1738
|
mode: z.ZodOptional<z.ZodString>;
|
|
1709
1739
|
}, z.core.$strip>>;
|
|
1710
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>>;
|
|
1745
|
+
}, z.core.$strip>>;
|
|
1711
1746
|
}, z.core.$strip>>;
|
|
1712
1747
|
}, z.core.$strip>>>;
|
|
1713
1748
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1731,6 +1766,11 @@ export declare const VisibleWorkspaceUserSchema: z.ZodUnion<readonly [z.ZodObjec
|
|
|
1731
1766
|
mode: z.ZodOptional<z.ZodString>;
|
|
1732
1767
|
}, z.core.$strip>>;
|
|
1733
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>>;
|
|
1773
|
+
}, z.core.$strip>>;
|
|
1734
1774
|
}, z.core.$strip>>;
|
|
1735
1775
|
}, z.core.$strip>>>;
|
|
1736
1776
|
id: z.ZodNumber;
|
|
@@ -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
|
-
|
|
198
|
-
|
|
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 = {
|