@doist/todoist-api-typescript 7.2.0 → 7.4.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.
Files changed (55) hide show
  1. package/dist/cjs/authentication.js +10 -0
  2. package/dist/cjs/rest-client.js +1 -1
  3. package/dist/cjs/test-utils/asserts.js +1 -1
  4. package/dist/cjs/test-utils/msw-setup.js +4 -3
  5. package/dist/cjs/todoist-api.js +6 -6
  6. package/dist/cjs/types/entities.js +45 -26
  7. package/dist/cjs/types/errors.js +0 -1
  8. package/dist/cjs/types/sync/commands/labels.js +3 -0
  9. package/dist/cjs/types/sync/commands/shared.js +21 -0
  10. package/dist/cjs/types/sync/resources/calendars.js +7 -3
  11. package/dist/cjs/types/sync/resources/collaborators.js +4 -2
  12. package/dist/cjs/types/sync/resources/reminders.js +8 -6
  13. package/dist/cjs/types/sync/resources/suggestions.js +11 -7
  14. package/dist/cjs/types/sync/resources/user-settings.js +5 -5
  15. package/dist/cjs/types/sync/resources/user.js +11 -15
  16. package/dist/cjs/types/sync/resources/view-options.js +33 -25
  17. package/dist/cjs/types/sync/user-preferences.js +27 -7
  18. package/dist/cjs/utils/sanitization.js +7 -7
  19. package/dist/esm/authentication.js +9 -0
  20. package/dist/esm/rest-client.js +1 -1
  21. package/dist/esm/test-utils/asserts.js +1 -1
  22. package/dist/esm/test-utils/msw-setup.js +1 -0
  23. package/dist/esm/todoist-api.js +6 -6
  24. package/dist/esm/types/entities.js +34 -15
  25. package/dist/esm/types/errors.js +0 -1
  26. package/dist/esm/types/sync/commands/labels.js +2 -1
  27. package/dist/esm/types/sync/commands/shared.js +20 -1
  28. package/dist/esm/types/sync/resources/calendars.js +6 -2
  29. package/dist/esm/types/sync/resources/collaborators.js +3 -1
  30. package/dist/esm/types/sync/resources/reminders.js +4 -2
  31. package/dist/esm/types/sync/resources/suggestions.js +8 -4
  32. package/dist/esm/types/sync/resources/user-settings.js +2 -2
  33. package/dist/esm/types/sync/resources/user.js +6 -10
  34. package/dist/esm/types/sync/resources/view-options.js +22 -14
  35. package/dist/esm/types/sync/user-preferences.js +23 -3
  36. package/dist/esm/utils/sanitization.js +7 -7
  37. package/dist/types/authentication.d.ts +5 -3
  38. package/dist/types/types/entities.d.ts +52 -2
  39. package/dist/types/types/sync/commands/labels.d.ts +5 -1
  40. package/dist/types/types/sync/commands/project-view-options.d.ts +2 -2
  41. package/dist/types/types/sync/commands/reminders.d.ts +3 -2
  42. package/dist/types/types/sync/commands/shared.d.ts +12 -4
  43. package/dist/types/types/sync/commands/view-options.d.ts +3 -7
  44. package/dist/types/types/sync/resources/calendars.d.ts +8 -0
  45. package/dist/types/types/sync/resources/collaborators.d.ts +4 -0
  46. package/dist/types/types/sync/resources/reminders.d.ts +11 -0
  47. package/dist/types/types/sync/resources/suggestions.d.ts +42 -0
  48. package/dist/types/types/sync/resources/user-settings.d.ts +8 -0
  49. package/dist/types/types/sync/resources/user.d.ts +32 -2
  50. package/dist/types/types/sync/resources/view-options.d.ts +75 -0
  51. package/dist/types/types/sync/user-preferences.d.ts +30 -4
  52. package/package.json +10 -17
  53. package/dist/cjs/test-utils/mocks.js +0 -3
  54. package/dist/esm/test-utils/mocks.js +0 -3
  55. package/dist/types/test-utils/mocks.d.ts +0 -0
@@ -1,7 +1,33 @@
1
1
  import { z } from 'zod';
2
- export type DateFormat = 'DD/MM/YYYY' | 'MM/DD/YYYY';
3
- export type TimeFormat = '24h' | '12h';
4
- export type DayOfWeek = 'Monday' | 'Tuesday' | 'Wednesday' | 'Thursday' | 'Friday' | 'Saturday' | 'Sunday';
2
+ /** Available date format options. */
3
+ export declare const DATE_FORMATS: readonly ["DD/MM/YYYY", "MM/DD/YYYY"];
4
+ /** User date format preference. */
5
+ export type DateFormat = (typeof DATE_FORMATS)[number];
6
+ /** Available time format options. */
7
+ export declare const TIME_FORMATS: readonly ["24h", "12h"];
8
+ /** User time format preference. */
9
+ export type TimeFormat = (typeof TIME_FORMATS)[number];
10
+ /** Available days of the week. */
11
+ export declare const DAYS_OF_WEEK: readonly ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
12
+ /** Day of the week. */
13
+ export type DayOfWeek = (typeof DAYS_OF_WEEK)[number];
14
+ export declare const DATE_FORMAT_FROM_API: {
15
+ readonly 0: "DD/MM/YYYY";
16
+ readonly 1: "MM/DD/YYYY";
17
+ };
18
+ export declare const TIME_FORMAT_FROM_API: {
19
+ readonly 0: "24h";
20
+ readonly 1: "12h";
21
+ };
22
+ export declare const DAY_OF_WEEK_FROM_API: {
23
+ readonly 1: "Monday";
24
+ readonly 2: "Tuesday";
25
+ readonly 3: "Wednesday";
26
+ readonly 4: "Thursday";
27
+ readonly 5: "Friday";
28
+ readonly 6: "Saturday";
29
+ readonly 7: "Sunday";
30
+ };
5
31
  export declare const DATE_FORMAT_TO_API: Record<DateFormat, 0 | 1>;
6
32
  export declare const TIME_FORMAT_TO_API: Record<TimeFormat, 0 | 1>;
7
33
  export declare const DAY_OF_WEEK_TO_API: Record<DayOfWeek, 1 | 2 | 3 | 4 | 5 | 6 | 7>;
@@ -10,4 +36,4 @@ export declare const BooleanFromZeroOneSchema: z.ZodPipe<z.ZodUnion<readonly [z.
10
36
  /** Zod read-schemas: parse API numbers, emit descriptive strings */
11
37
  export declare const DateFormatSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"DD/MM/YYYY" | "MM/DD/YYYY", 0 | 1>>;
12
38
  export declare const TimeFormatSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
13
- export declare const DayOfWeekSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
39
+ export declare const DayOfWeekSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 7 | 6>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-api-typescript",
3
- "version": "7.2.0",
3
+ "version": "7.4.0",
4
4
  "description": "A typescript wrapper for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "https://github.com/Doist/todoist-api-typescript",
@@ -25,11 +25,13 @@
25
25
  "clean": "rimraf dist",
26
26
  "format-check": "npx prettier --check \"./**/*.{ts,tsx,json,md,yml,babelrc,html}\" --ignore-path .prettierignore",
27
27
  "format-fix": "npx prettier --write \"./**/*.{ts,tsx,json,md,yml,babelrc,html}\" --ignore-path .prettierignore",
28
- "lint": "eslint ./src --ext ts,tsx --fix",
29
- "lint-check": "eslint ./src --ext ts,tsx",
28
+ "lint": "oxlint src --fix",
29
+ "lint-check": "oxlint src",
30
30
  "ts-compile-check": "npx tsc -p tsconfig.typecheck.json",
31
31
  "audit": "npm audit --audit-level=moderate",
32
- "test": "jest",
32
+ "test": "vitest run",
33
+ "test:watch": "vitest",
34
+ "test:coverage": "vitest run --coverage",
33
35
  "api:request": "node ./scripts/todoist-api-request.cjs",
34
36
  "build:cjs": "npx tsc -p tsconfig.cjs.json",
35
37
  "build:esm": "npx tsc -p tsconfig.esm.json",
@@ -52,29 +54,20 @@
52
54
  "zod": "4.3.6"
53
55
  },
54
56
  "devDependencies": {
55
- "@doist/eslint-config": "12.0.0",
56
57
  "@doist/prettier-config": "4.0.0",
57
- "@types/jest": "30.0.0",
58
- "@typescript-eslint/eslint-plugin": "8.46.3",
59
- "@typescript-eslint/parser": "8.46.3",
60
58
  "dotenv": "17.3.1",
61
- "eslint": "8.57.1",
62
- "eslint-config-prettier": "8.7.0",
63
- "eslint-import-resolver-webpack": "0.13.2",
64
- "eslint-plugin-import": "2.27.5",
65
- "eslint-plugin-prettier": "5.1.3",
66
59
  "husky": "9.1.7",
67
- "jest": "30.1.3",
68
60
  "lint-staged": "16.2.7",
69
61
  "msw": "2.12.10",
70
62
  "npm-run-all2": "8.0.4",
71
63
  "obsidian": "^1.10.2-1",
64
+ "oxlint": "1.57.0",
72
65
  "prettier": "3.3.2",
73
66
  "rimraf": "6.1.2",
74
- "ts-jest": "29.4.6",
75
67
  "ts-node": "10.9.2",
76
68
  "type-fest": "^5.0.0",
77
- "typescript": "5.9.3"
69
+ "typescript": "5.9.3",
70
+ "vitest": "4.0.14"
78
71
  },
79
72
  "peerDependencies": {
80
73
  "type-fest": "^4.12.0"
@@ -86,7 +79,7 @@
86
79
  }
87
80
  },
88
81
  "lint-staged": {
89
- "*.{ts,tsx}": "eslint --fix",
82
+ "*.{ts,tsx}": "oxlint --fix",
90
83
  "*.{ts,tsx,json,html,yml,yaml,md}": "prettier --check"
91
84
  },
92
85
  "files": [
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file is reserved for future test utilities
3
- // All network mocking is now handled by MSW in msw-setup.ts
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // This file is reserved for future test utilities
3
- // All network mocking is now handled by MSW in msw-setup.ts
File without changes