@doist/todoist-sdk 13.0.1 → 14.0.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.
@@ -47,7 +47,7 @@ class TaskClient extends base_client_1.BaseClient {
47
47
  relativePath: endpoints_1.ENDPOINT_REST_TASKS,
48
48
  apiToken: this.authToken,
49
49
  customFetch: this.customFetch,
50
- payload: args,
50
+ payload: Object.assign(Object.assign({}, args), (0, request_helpers_1.spreadIfDefined)(args.ids, (ids) => ({ ids: ids.join(',') }))),
51
51
  });
52
52
  return {
53
53
  results: (0, validators_1.validateTaskArray)(results),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WorkspaceInsightsSchema = exports.ProjectInsightSchema = exports.ProjectProgressSchema = exports.ProjectHealthContextSchema = exports.TaskContextSchema = exports.ProjectMetricsSchema = exports.ProjectHealthSchema = exports.TaskRecommendationSchema = exports.HEALTH_STATUSES = exports.ProjectActivityStatsSchema = exports.WeekRollupSchema = exports.DayActivitySchema = void 0;
3
+ exports.WorkspaceInsightsSchema = exports.ProjectInsightSchema = exports.ProjectProgressSchema = exports.ProjectHealthContextSchema = exports.TaskContextSchema = exports.ProjectMetricsSchema = exports.ProjectHealthSchema = exports.HEALTH_STATUSES = exports.ProjectActivityStatsSchema = exports.WeekRollupSchema = exports.DayActivitySchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.DayActivitySchema = zod_1.z.object({
6
6
  // Kept as string: this is a calendar-day bucket (e.g. '2025-01-13'), not a timestamp.
@@ -26,15 +26,10 @@ exports.HEALTH_STATUSES = [
26
26
  'EXCELLENT',
27
27
  'ERROR',
28
28
  ];
29
- exports.TaskRecommendationSchema = zod_1.z.object({
30
- taskId: zod_1.z.string(),
31
- recommendation: zod_1.z.string(),
32
- });
33
29
  exports.ProjectHealthSchema = zod_1.z.object({
34
30
  status: zod_1.z.enum(exports.HEALTH_STATUSES),
35
31
  description: zod_1.z.string().nullable().optional(),
36
32
  descriptionSummary: zod_1.z.string().nullable().optional(),
37
- taskRecommendations: zod_1.z.array(exports.TaskRecommendationSchema).nullable().optional(),
38
33
  projectId: zod_1.z.string().nullable().optional(),
39
34
  updatedAt: zod_1.z.coerce.date().nullable().optional(),
40
35
  isStale: zod_1.z.boolean().default(false),
@@ -81,6 +76,5 @@ exports.ProjectInsightSchema = zod_1.z.object({
81
76
  progress: exports.ProjectProgressSchema.nullable(),
82
77
  });
83
78
  exports.WorkspaceInsightsSchema = zod_1.z.object({
84
- folderId: zod_1.z.string().nullable(),
85
79
  projectInsights: zod_1.z.array(exports.ProjectInsightSchema),
86
80
  });
@@ -44,7 +44,7 @@ export class TaskClient extends BaseClient {
44
44
  relativePath: ENDPOINT_REST_TASKS,
45
45
  apiToken: this.authToken,
46
46
  customFetch: this.customFetch,
47
- payload: args,
47
+ payload: Object.assign(Object.assign({}, args), spreadIfDefined(args.ids, (ids) => ({ ids: ids.join(',') }))),
48
48
  });
49
49
  return {
50
50
  results: validateTaskArray(results),
@@ -23,15 +23,10 @@ export const HEALTH_STATUSES = [
23
23
  'EXCELLENT',
24
24
  'ERROR',
25
25
  ];
26
- export const TaskRecommendationSchema = z.object({
27
- taskId: z.string(),
28
- recommendation: z.string(),
29
- });
30
26
  export const ProjectHealthSchema = z.object({
31
27
  status: z.enum(HEALTH_STATUSES),
32
28
  description: z.string().nullable().optional(),
33
29
  descriptionSummary: z.string().nullable().optional(),
34
- taskRecommendations: z.array(TaskRecommendationSchema).nullable().optional(),
35
30
  projectId: z.string().nullable().optional(),
36
31
  updatedAt: z.coerce.date().nullable().optional(),
37
32
  isStale: z.boolean().default(false),
@@ -78,6 +73,5 @@ export const ProjectInsightSchema = z.object({
78
73
  progress: ProjectProgressSchema.nullable(),
79
74
  });
80
75
  export const WorkspaceInsightsSchema = z.object({
81
- folderId: z.string().nullable(),
82
76
  projectInsights: z.array(ProjectInsightSchema),
83
77
  });
@@ -29,12 +29,6 @@ export type ProjectActivityStats = z.infer<typeof ProjectActivityStatsSchema>;
29
29
  export declare const HEALTH_STATUSES: readonly ["UNKNOWN", "ON_TRACK", "AT_RISK", "CRITICAL", "EXCELLENT", "ERROR"];
30
30
  /** Health status of a project. */
31
31
  export type HealthStatus = (typeof HEALTH_STATUSES)[number];
32
- export declare const TaskRecommendationSchema: z.ZodObject<{
33
- taskId: z.ZodString;
34
- recommendation: z.ZodString;
35
- }, z.core.$strip>;
36
- /** A recommendation for a specific task. */
37
- export type TaskRecommendation = z.infer<typeof TaskRecommendationSchema>;
38
32
  export declare const ProjectHealthSchema: z.ZodObject<{
39
33
  status: z.ZodEnum<{
40
34
  UNKNOWN: "UNKNOWN";
@@ -46,16 +40,12 @@ export declare const ProjectHealthSchema: z.ZodObject<{
46
40
  }>;
47
41
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
42
  descriptionSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
- taskRecommendations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
50
- taskId: z.ZodString;
51
- recommendation: z.ZodString;
52
- }, z.core.$strip>>>>;
53
43
  projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
44
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
55
45
  isStale: z.ZodDefault<z.ZodBoolean>;
56
46
  updateInProgress: z.ZodDefault<z.ZodBoolean>;
57
47
  }, z.core.$strip>;
58
- /** Project health status and recommendations. */
48
+ /** Project health status. */
59
49
  export type ProjectHealth = z.infer<typeof ProjectHealthSchema>;
60
50
  export declare const ProjectMetricsSchema: z.ZodObject<{
61
51
  totalTasks: z.ZodNumber;
@@ -132,10 +122,6 @@ export declare const ProjectInsightSchema: z.ZodObject<{
132
122
  }>;
133
123
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
124
  descriptionSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
- taskRecommendations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
136
- taskId: z.ZodString;
137
- recommendation: z.ZodString;
138
- }, z.core.$strip>>>>;
139
125
  projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
126
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
141
127
  isStale: z.ZodDefault<z.ZodBoolean>;
@@ -151,7 +137,6 @@ export declare const ProjectInsightSchema: z.ZodObject<{
151
137
  /** Insight data for a single project within a workspace. */
152
138
  export type ProjectInsight = z.infer<typeof ProjectInsightSchema>;
153
139
  export declare const WorkspaceInsightsSchema: z.ZodObject<{
154
- folderId: z.ZodNullable<z.ZodString>;
155
140
  projectInsights: z.ZodArray<z.ZodObject<{
156
141
  projectId: z.ZodString;
157
142
  health: z.ZodNullable<z.ZodObject<{
@@ -165,10 +150,6 @@ export declare const WorkspaceInsightsSchema: z.ZodObject<{
165
150
  }>;
166
151
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
152
  descriptionSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
- taskRecommendations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
169
- taskId: z.ZodString;
170
- recommendation: z.ZodString;
171
- }, z.core.$strip>>>>;
172
153
  projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
154
  updatedAt: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
174
155
  isStale: z.ZodDefault<z.ZodBoolean>;
@@ -182,5 +163,5 @@ export declare const WorkspaceInsightsSchema: z.ZodObject<{
182
163
  }, z.core.$strip>>;
183
164
  }, z.core.$strip>>;
184
165
  }, z.core.$strip>;
185
- /** Workspace insights grouped by folder. */
166
+ /** Insights for the projects in a workspace. */
186
167
  export type WorkspaceInsights = z.infer<typeof WorkspaceInsightsSchema>;
@@ -664,10 +664,6 @@ export declare const validateProjectHealth: (input: unknown) => {
664
664
  updateInProgress: boolean;
665
665
  description?: string | null | undefined;
666
666
  descriptionSummary?: string | null | undefined;
667
- taskRecommendations?: {
668
- taskId: string;
669
- recommendation: string;
670
- }[] | null | undefined;
671
667
  projectId?: string | null | undefined;
672
668
  updatedAt?: Date | null | undefined;
673
669
  };
@@ -705,7 +701,6 @@ export declare const validateProjectProgress: (input: unknown) => {
705
701
  progressPercent: number;
706
702
  };
707
703
  export declare const validateWorkspaceInsights: (input: unknown) => {
708
- folderId: string | null;
709
704
  projectInsights: {
710
705
  projectId: string;
711
706
  health: {
@@ -714,10 +709,6 @@ export declare const validateWorkspaceInsights: (input: unknown) => {
714
709
  updateInProgress: boolean;
715
710
  description?: string | null | undefined;
716
711
  descriptionSummary?: string | null | undefined;
717
- taskRecommendations?: {
718
- taskId: string;
719
- recommendation: string;
720
- }[] | null | undefined;
721
712
  projectId?: string | null | undefined;
722
713
  updatedAt?: Date | null | undefined;
723
714
  } | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-sdk",
3
- "version": "13.0.1",
3
+ "version": "14.0.0",
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",