@doist/todoist-sdk 15.0.0 → 15.0.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.
@@ -1,4 +1,5 @@
1
1
  export * from './filters.js';
2
+ export * from './labels.js';
2
3
  export * from './collaborators.js';
3
4
  export * from './folders.js';
4
5
  export * from './tooltips.js';
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { LabelSchema } from '../../labels/types.js';
3
+ /** A label returned by the Sync API. */
4
+ export const SyncLabelSchema = LabelSchema.extend({
5
+ order: z.number().int().nullable().optional(),
6
+ isDeleted: z.boolean().optional(),
7
+ });
@@ -45,3 +45,14 @@ export const ReminderSchema = z.discriminatedUnion('type', [
45
45
  AbsoluteReminderSchema,
46
46
  RelativeReminderSchema,
47
47
  ]);
48
+ export const SyncAbsoluteReminderSchema = AbsoluteReminderSchema.extend({
49
+ due: DueDateSchema.nullable(),
50
+ });
51
+ export const SyncRelativeReminderSchema = RelativeReminderSchema.extend({
52
+ due: DueDateSchema.nullable().optional(),
53
+ });
54
+ export const SyncReminderSchema = z.discriminatedUnion('type', [
55
+ LocationReminderSchema,
56
+ SyncAbsoluteReminderSchema,
57
+ SyncRelativeReminderSchema,
58
+ ]);
@@ -1,10 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { LabelSchema } from '../labels/types.js';
3
2
  import { ProjectSchema } from '../projects/types.js';
4
3
  import { SectionSchema } from '../sections/types.js';
5
4
  import { TaskSchema } from '../tasks/types.js';
6
5
  import { WorkspaceUserSchema } from '../workspaces/types.js';
7
- import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, CalendarSchema, CalendarAccountSchema, ReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from './resources/index.js';
6
+ import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, CalendarSchema, CalendarAccountSchema, SyncLabelSchema, SyncReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from './resources/index.js';
8
7
  export const SyncErrorSchema = z.object({
9
8
  error: z.string(),
10
9
  errorCode: z.number(),
@@ -20,11 +19,11 @@ export const SyncResponseSchema = z.looseObject({
20
19
  items: z.array(TaskSchema).optional(),
21
20
  projects: z.array(ProjectSchema).optional(),
22
21
  sections: z.array(SectionSchema).optional(),
23
- labels: z.array(LabelSchema).optional(),
22
+ labels: z.array(SyncLabelSchema).optional(),
24
23
  notes: z.array(NoteSchema).optional(),
25
24
  projectNotes: z.array(NoteSchema).optional(),
26
25
  filters: z.array(FilterSchema).optional(),
27
- reminders: z.array(ReminderSchema).optional(),
26
+ reminders: z.array(SyncReminderSchema).optional(),
28
27
  remindersLocation: z.array(LocationReminderSchema).optional(),
29
28
  locations: z.array(z.record(z.string(), z.unknown())).optional(),
30
29
  user: SyncUserSchema.optional(),
@@ -1,4 +1,5 @@
1
1
  export * from './filters.js';
2
+ export * from './labels.js';
2
3
  export * from './collaborators.js';
3
4
  export * from './folders.js';
4
5
  export * from './tooltips.js';
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ /** A label returned by the Sync API. */
3
+ export declare const SyncLabelSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ name: z.ZodString;
6
+ color: z.ZodString;
7
+ isFavorite: z.ZodBoolean;
8
+ order: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9
+ isDeleted: z.ZodOptional<z.ZodBoolean>;
10
+ }, z.core.$strip>;
11
+ /** Represents a label returned by the Sync API. */
12
+ export type SyncLabel = z.infer<typeof SyncLabelSchema>;
@@ -124,3 +124,90 @@ export declare const ReminderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
124
124
  isUrgent: z.ZodOptional<z.ZodBoolean>;
125
125
  }, z.core.$loose>], "type">;
126
126
  export type Reminder = z.infer<typeof ReminderSchema>;
127
+ export declare const SyncAbsoluteReminderSchema: z.ZodObject<{
128
+ id: z.ZodString;
129
+ notifyUid: z.ZodString;
130
+ itemId: z.ZodString;
131
+ projectId: z.ZodOptional<z.ZodString>;
132
+ isDeleted: z.ZodBoolean;
133
+ type: z.ZodLiteral<"absolute">;
134
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
135
+ due: z.ZodNullable<z.ZodObject<{
136
+ isRecurring: z.ZodBoolean;
137
+ string: z.ZodString;
138
+ date: z.ZodString;
139
+ datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
+ }, z.core.$strip>>;
143
+ }, z.core.$loose>;
144
+ export type SyncAbsoluteReminder = z.infer<typeof SyncAbsoluteReminderSchema>;
145
+ export declare const SyncRelativeReminderSchema: z.ZodObject<{
146
+ id: z.ZodString;
147
+ notifyUid: z.ZodString;
148
+ itemId: z.ZodString;
149
+ projectId: z.ZodOptional<z.ZodString>;
150
+ isDeleted: z.ZodBoolean;
151
+ type: z.ZodLiteral<"relative">;
152
+ minuteOffset: z.ZodNumber;
153
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
154
+ due: z.ZodOptional<z.ZodNullable<z.ZodObject<{
155
+ isRecurring: z.ZodBoolean;
156
+ string: z.ZodString;
157
+ date: z.ZodString;
158
+ datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
160
+ lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ }, z.core.$strip>>>;
162
+ }, z.core.$loose>;
163
+ export type SyncRelativeReminder = z.infer<typeof SyncRelativeReminderSchema>;
164
+ export declare const SyncReminderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
165
+ id: z.ZodString;
166
+ notifyUid: z.ZodString;
167
+ itemId: z.ZodString;
168
+ projectId: z.ZodOptional<z.ZodString>;
169
+ isDeleted: z.ZodBoolean;
170
+ type: z.ZodLiteral<"location">;
171
+ name: z.ZodString;
172
+ locLat: z.ZodString;
173
+ locLong: z.ZodString;
174
+ locTrigger: z.ZodEnum<{
175
+ on_enter: "on_enter";
176
+ on_leave: "on_leave";
177
+ }>;
178
+ radius: z.ZodNumber;
179
+ }, z.core.$loose>, z.ZodObject<{
180
+ id: z.ZodString;
181
+ notifyUid: z.ZodString;
182
+ itemId: z.ZodString;
183
+ projectId: z.ZodOptional<z.ZodString>;
184
+ isDeleted: z.ZodBoolean;
185
+ type: z.ZodLiteral<"absolute">;
186
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
187
+ due: z.ZodNullable<z.ZodObject<{
188
+ isRecurring: z.ZodBoolean;
189
+ string: z.ZodString;
190
+ date: z.ZodString;
191
+ datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
+ lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
194
+ }, z.core.$strip>>;
195
+ }, z.core.$loose>, z.ZodObject<{
196
+ id: z.ZodString;
197
+ notifyUid: z.ZodString;
198
+ itemId: z.ZodString;
199
+ projectId: z.ZodOptional<z.ZodString>;
200
+ isDeleted: z.ZodBoolean;
201
+ type: z.ZodLiteral<"relative">;
202
+ minuteOffset: z.ZodNumber;
203
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
204
+ due: z.ZodOptional<z.ZodNullable<z.ZodObject<{
205
+ isRecurring: z.ZodBoolean;
206
+ string: z.ZodString;
207
+ date: z.ZodString;
208
+ datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
209
+ timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
210
+ lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
211
+ }, z.core.$strip>>>;
212
+ }, z.core.$loose>], "type">;
213
+ export type SyncReminder = z.infer<typeof SyncReminderSchema>;
@@ -229,10 +229,11 @@ export declare const SyncResponseSchema: z.ZodObject<{
229
229
  }>>>>;
230
230
  labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
231
231
  id: z.ZodString;
232
- order: z.ZodNullable<z.ZodNumber>;
233
232
  name: z.ZodString;
234
233
  color: z.ZodString;
235
234
  isFavorite: z.ZodBoolean;
235
+ order: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
236
+ isDeleted: z.ZodOptional<z.ZodBoolean>;
236
237
  }, z.core.$strip>>>;
237
238
  notes: z.ZodOptional<z.ZodArray<z.ZodObject<{
238
239
  id: z.ZodString;
@@ -322,15 +323,15 @@ export declare const SyncResponseSchema: z.ZodObject<{
322
323
  projectId: z.ZodOptional<z.ZodString>;
323
324
  isDeleted: z.ZodBoolean;
324
325
  type: z.ZodLiteral<"absolute">;
325
- due: z.ZodObject<{
326
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
327
+ due: z.ZodNullable<z.ZodObject<{
326
328
  isRecurring: z.ZodBoolean;
327
329
  string: z.ZodString;
328
330
  date: z.ZodString;
329
331
  datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
330
332
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
331
333
  lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
- }, z.core.$strip>;
333
- isUrgent: z.ZodOptional<z.ZodBoolean>;
334
+ }, z.core.$strip>>;
334
335
  }, z.core.$loose>, z.ZodObject<{
335
336
  id: z.ZodString;
336
337
  notifyUid: z.ZodString;
@@ -339,15 +340,15 @@ export declare const SyncResponseSchema: z.ZodObject<{
339
340
  isDeleted: z.ZodBoolean;
340
341
  type: z.ZodLiteral<"relative">;
341
342
  minuteOffset: z.ZodNumber;
342
- due: z.ZodOptional<z.ZodObject<{
343
+ isUrgent: z.ZodOptional<z.ZodBoolean>;
344
+ due: z.ZodOptional<z.ZodNullable<z.ZodObject<{
343
345
  isRecurring: z.ZodBoolean;
344
346
  string: z.ZodString;
345
347
  date: z.ZodString;
346
348
  datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
349
  timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
348
350
  lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
349
- }, z.core.$strip>>;
350
- isUrgent: z.ZodOptional<z.ZodBoolean>;
351
+ }, z.core.$strip>>>;
351
352
  }, z.core.$loose>], "type">>>;
352
353
  remindersLocation: z.ZodOptional<z.ZodArray<z.ZodObject<{
353
354
  id: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "15.0.0",
3
+ "version": "15.0.1",
4
4
  "description": "The official TypeScript SDK for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "https://github.com/Doist/todoist-sdk-typescript",