@doist/todoist-api-typescript 7.5.0 → 7.6.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.
- package/dist/cjs/authentication.js +46 -2
- package/dist/cjs/consts/endpoints.js +54 -2
- package/dist/cjs/todoist-api.js +524 -6
- package/dist/cjs/types/activity/index.js +18 -0
- package/dist/cjs/types/activity/requests.js +2 -0
- package/dist/cjs/types/activity/types.js +28 -0
- package/dist/cjs/types/backups/index.js +18 -0
- package/dist/cjs/types/backups/requests.js +2 -0
- package/dist/cjs/types/backups/types.js +8 -0
- package/dist/cjs/types/comments/index.js +18 -0
- package/dist/cjs/types/comments/requests.js +2 -0
- package/dist/cjs/types/comments/types.js +60 -0
- package/dist/cjs/types/common.js +2 -0
- package/dist/cjs/types/emails/index.js +17 -0
- package/dist/cjs/types/emails/requests.js +5 -0
- package/dist/cjs/types/id-mappings/index.js +18 -0
- package/dist/cjs/types/id-mappings/requests.js +20 -0
- package/dist/cjs/types/id-mappings/types.js +12 -0
- package/dist/cjs/types/index.js +16 -2
- package/dist/cjs/types/insights/index.js +18 -0
- package/dist/cjs/types/insights/requests.js +2 -0
- package/dist/cjs/types/insights/types.js +84 -0
- package/dist/cjs/types/labels/index.js +18 -0
- package/dist/cjs/types/labels/requests.js +2 -0
- package/dist/cjs/types/labels/types.js +11 -0
- package/dist/cjs/types/productivity/index.js +17 -0
- package/dist/cjs/types/productivity/types.js +67 -0
- package/dist/cjs/types/projects/index.js +18 -0
- package/dist/cjs/types/projects/requests.js +2 -0
- package/dist/cjs/types/projects/types.js +56 -0
- package/dist/cjs/types/reminders/index.js +17 -0
- package/dist/cjs/types/sections/index.js +18 -0
- package/dist/cjs/types/sections/requests.js +2 -0
- package/dist/cjs/types/sections/types.js +22 -0
- package/dist/cjs/types/sync/commands/shared.js +2 -2
- package/dist/cjs/types/sync/resources/collaborators.js +2 -2
- package/dist/cjs/types/sync/resources/notes.js +2 -2
- package/dist/cjs/types/sync/resources/reminders.js +3 -3
- package/dist/cjs/types/sync/resources/user.js +2 -2
- package/dist/cjs/types/sync/resources/workspaces.js +5 -5
- package/dist/cjs/types/tasks/index.js +18 -0
- package/dist/cjs/types/tasks/requests.js +2 -0
- package/dist/cjs/types/tasks/types.js +59 -0
- package/dist/cjs/types/templates/index.js +17 -0
- package/dist/cjs/types/templates/requests.js +2 -0
- package/dist/cjs/types/uploads/index.js +17 -0
- package/dist/cjs/types/uploads/requests.js +2 -0
- package/dist/cjs/types/users/index.js +17 -0
- package/dist/cjs/types/users/types.js +51 -0
- package/dist/cjs/types/workspaces/index.js +18 -0
- package/dist/cjs/types/workspaces/requests.js +2 -0
- package/dist/cjs/types/workspaces/types.js +137 -0
- package/dist/cjs/utils/validators.js +47 -19
- package/dist/esm/authentication.js +46 -3
- package/dist/esm/consts/endpoints.js +43 -0
- package/dist/esm/todoist-api.js +522 -4
- package/dist/esm/types/activity/index.js +2 -0
- package/dist/esm/types/activity/requests.js +1 -0
- package/dist/esm/types/activity/types.js +25 -0
- package/dist/esm/types/backups/index.js +2 -0
- package/dist/esm/types/backups/requests.js +1 -0
- package/dist/esm/types/backups/types.js +5 -0
- package/dist/esm/types/comments/index.js +2 -0
- package/dist/esm/types/comments/requests.js +1 -0
- package/dist/esm/types/comments/types.js +57 -0
- package/dist/esm/types/common.js +1 -0
- package/dist/esm/types/emails/index.js +1 -0
- package/dist/esm/types/emails/requests.js +2 -0
- package/dist/esm/types/id-mappings/index.js +2 -0
- package/dist/esm/types/id-mappings/requests.js +17 -0
- package/dist/esm/types/id-mappings/types.js +9 -0
- package/dist/esm/types/index.js +16 -2
- package/dist/esm/types/insights/index.js +2 -0
- package/dist/esm/types/insights/requests.js +1 -0
- package/dist/esm/types/insights/types.js +81 -0
- package/dist/esm/types/labels/index.js +2 -0
- package/dist/esm/types/labels/requests.js +1 -0
- package/dist/esm/types/labels/types.js +8 -0
- package/dist/esm/types/productivity/index.js +1 -0
- package/dist/esm/types/productivity/types.js +64 -0
- package/dist/esm/types/projects/index.js +2 -0
- package/dist/esm/types/projects/requests.js +1 -0
- package/dist/esm/types/projects/types.js +53 -0
- package/dist/esm/types/reminders/index.js +1 -0
- package/dist/esm/types/sections/index.js +2 -0
- package/dist/esm/types/sections/requests.js +1 -0
- package/dist/esm/types/sections/types.js +19 -0
- package/dist/esm/types/sync/commands/shared.js +1 -1
- package/dist/esm/types/sync/resources/collaborators.js +1 -1
- package/dist/esm/types/sync/resources/notes.js +1 -1
- package/dist/esm/types/sync/resources/reminders.js +1 -1
- package/dist/esm/types/sync/resources/user.js +1 -1
- package/dist/esm/types/sync/resources/workspaces.js +1 -1
- package/dist/esm/types/tasks/index.js +2 -0
- package/dist/esm/types/tasks/requests.js +1 -0
- package/dist/esm/types/tasks/types.js +56 -0
- package/dist/esm/types/templates/index.js +1 -0
- package/dist/esm/types/templates/requests.js +1 -0
- package/dist/esm/types/uploads/index.js +1 -0
- package/dist/esm/types/uploads/requests.js +1 -0
- package/dist/esm/types/users/index.js +1 -0
- package/dist/esm/types/users/types.js +48 -0
- package/dist/esm/types/workspaces/index.js +2 -0
- package/dist/esm/types/workspaces/requests.js +1 -0
- package/dist/esm/types/workspaces/types.js +134 -0
- package/dist/esm/utils/validators.js +30 -2
- package/dist/types/authentication.d.ts +51 -6
- package/dist/types/consts/endpoints.d.ts +22 -0
- package/dist/types/test-utils/test-defaults.d.ts +5 -5
- package/dist/types/todoist-api.d.ts +209 -4
- package/dist/types/types/activity/index.d.ts +2 -0
- package/dist/types/types/activity/requests.d.ts +85 -0
- package/dist/types/types/activity/types.d.ts +49 -0
- package/dist/types/types/backups/index.d.ts +2 -0
- package/dist/types/types/backups/requests.d.ts +16 -0
- package/dist/types/types/backups/types.d.ts +7 -0
- package/dist/types/types/comments/index.d.ts +2 -0
- package/dist/types/types/comments/requests.d.ts +63 -0
- package/dist/types/types/comments/types.d.ts +141 -0
- package/dist/types/types/common.d.ts +6 -0
- package/dist/types/types/emails/index.d.ts +1 -0
- package/dist/types/types/emails/requests.d.ts +30 -0
- package/dist/types/types/id-mappings/index.d.ts +2 -0
- package/dist/types/types/id-mappings/requests.d.ts +28 -0
- package/dist/types/types/id-mappings/types.d.ts +13 -0
- package/dist/types/types/index.d.ts +16 -2
- package/dist/types/types/insights/index.d.ts +2 -0
- package/dist/types/types/insights/requests.d.ts +26 -0
- package/dist/types/types/insights/types.d.ts +186 -0
- package/dist/types/types/labels/index.d.ts +2 -0
- package/dist/types/types/labels/requests.d.ts +75 -0
- package/dist/types/types/labels/types.d.ts +13 -0
- package/dist/types/types/productivity/index.d.ts +1 -0
- package/dist/types/types/productivity/types.d.ts +115 -0
- package/dist/types/types/projects/index.d.ts +2 -0
- package/dist/types/types/projects/requests.d.ts +169 -0
- package/dist/types/types/projects/types.d.ts +201 -0
- package/dist/types/types/reminders/index.d.ts +1 -0
- package/dist/types/types/reminders/requests.d.ts +91 -0
- package/dist/types/types/sections/index.d.ts +2 -0
- package/dist/types/types/sections/requests.d.ts +41 -0
- package/dist/types/types/sections/types.d.ts +44 -0
- package/dist/types/types/sync/commands/projects.d.ts +2 -1
- package/dist/types/types/sync/commands/shared.d.ts +2 -2
- package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
- package/dist/types/types/sync/resources/notes.d.ts +1 -1
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/resources/view-options.d.ts +5 -5
- package/dist/types/types/sync/response.d.ts +5 -1
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/tasks/index.d.ts +2 -0
- package/dist/types/types/tasks/requests.d.ts +197 -0
- package/dist/types/types/tasks/types.d.ts +162 -0
- package/dist/types/types/templates/index.d.ts +1 -0
- package/dist/types/types/templates/requests.d.ts +92 -0
- package/dist/types/types/uploads/index.d.ts +1 -0
- package/dist/types/types/uploads/requests.d.ts +32 -0
- package/dist/types/types/users/index.d.ts +1 -0
- package/dist/types/types/users/types.d.ts +66 -0
- package/dist/types/types/workspaces/index.d.ts +2 -0
- package/dist/types/types/workspaces/requests.d.ts +260 -0
- package/dist/types/types/workspaces/types.d.ts +225 -0
- package/dist/types/utils/colors.d.ts +1 -1
- package/dist/types/utils/validators.d.ts +205 -12
- package/package.json +1 -1
- package/dist/cjs/types/entities.js +0 -437
- package/dist/esm/types/entities.js +0 -434
- package/dist/types/types/entities.d.ts +0 -971
- package/dist/types/types/requests.d.ts +0 -856
- /package/dist/cjs/types/{requests.js → reminders/requests.js} +0 -0
- /package/dist/esm/types/{requests.js → reminders/requests.js} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.CommentSchema = exports.RawCommentSchema = exports.AttachmentSchema = exports.UPLOAD_STATES = void 0;
|
|
15
|
+
const zod_1 = require("zod");
|
|
16
|
+
/** Available file attachment upload states. */
|
|
17
|
+
exports.UPLOAD_STATES = ['pending', 'completed'];
|
|
18
|
+
exports.AttachmentSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
resourceType: zod_1.z.string(),
|
|
21
|
+
})
|
|
22
|
+
.extend({
|
|
23
|
+
fileName: zod_1.z.string().nullable().optional(),
|
|
24
|
+
fileSize: zod_1.z.number().int().nullable().optional(),
|
|
25
|
+
fileType: zod_1.z.string().nullable().optional(),
|
|
26
|
+
fileUrl: zod_1.z.string().nullable().optional(),
|
|
27
|
+
fileDuration: zod_1.z.number().int().nullable().optional(),
|
|
28
|
+
uploadState: zod_1.z.enum(exports.UPLOAD_STATES).nullable().optional(),
|
|
29
|
+
image: zod_1.z.string().nullable().optional(),
|
|
30
|
+
imageWidth: zod_1.z.number().int().nullable().optional(),
|
|
31
|
+
imageHeight: zod_1.z.number().int().nullable().optional(),
|
|
32
|
+
url: zod_1.z.string().nullable().optional(),
|
|
33
|
+
title: zod_1.z.string().nullable().optional(),
|
|
34
|
+
});
|
|
35
|
+
exports.RawCommentSchema = zod_1.z
|
|
36
|
+
.object({
|
|
37
|
+
id: zod_1.z.string(),
|
|
38
|
+
itemId: zod_1.z.string().optional(),
|
|
39
|
+
projectId: zod_1.z.string().optional(),
|
|
40
|
+
content: zod_1.z.string(),
|
|
41
|
+
postedAt: zod_1.z.string(),
|
|
42
|
+
fileAttachment: exports.AttachmentSchema.nullable(),
|
|
43
|
+
postedUid: zod_1.z.string(),
|
|
44
|
+
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
45
|
+
reactions: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string())).nullable(),
|
|
46
|
+
isDeleted: zod_1.z.boolean(),
|
|
47
|
+
})
|
|
48
|
+
.refine((data) => {
|
|
49
|
+
// At least one of itemId or projectId must be present
|
|
50
|
+
return ((data.itemId !== undefined && data.projectId === undefined) ||
|
|
51
|
+
(data.itemId === undefined && data.projectId !== undefined));
|
|
52
|
+
}, {
|
|
53
|
+
message: 'Exactly one of itemId or projectId must be provided',
|
|
54
|
+
});
|
|
55
|
+
exports.CommentSchema = exports.RawCommentSchema.transform((data) => {
|
|
56
|
+
const { itemId } = data, rest = __rest(data, ["itemId"]);
|
|
57
|
+
return Object.assign(Object.assign({}, rest), {
|
|
58
|
+
// Map itemId to taskId for backwards compatibility
|
|
59
|
+
taskId: itemId });
|
|
60
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MOVED_ID_OBJECT_TYPES = exports.ID_MAPPING_OBJECT_TYPES = void 0;
|
|
4
|
+
/** Object types that support ID mappings. */
|
|
5
|
+
exports.ID_MAPPING_OBJECT_TYPES = [
|
|
6
|
+
'sections',
|
|
7
|
+
'tasks',
|
|
8
|
+
'comments',
|
|
9
|
+
'reminders',
|
|
10
|
+
'location_reminders',
|
|
11
|
+
'projects',
|
|
12
|
+
];
|
|
13
|
+
/** Object types that support moved ID lookups. */
|
|
14
|
+
exports.MOVED_ID_OBJECT_TYPES = [
|
|
15
|
+
'sections',
|
|
16
|
+
'tasks',
|
|
17
|
+
'comments',
|
|
18
|
+
'reminders',
|
|
19
|
+
'location_reminders',
|
|
20
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MovedIdSchema = exports.IdMappingSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.IdMappingSchema = zod_1.z.object({
|
|
6
|
+
oldId: zod_1.z.string().nullable(),
|
|
7
|
+
newId: zod_1.z.string().nullable(),
|
|
8
|
+
});
|
|
9
|
+
exports.MovedIdSchema = zod_1.z.object({
|
|
10
|
+
oldId: zod_1.z.string(),
|
|
11
|
+
newId: zod_1.z.string(),
|
|
12
|
+
});
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -14,8 +14,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./tasks"), exports);
|
|
18
|
+
__exportStar(require("./projects"), exports);
|
|
19
|
+
__exportStar(require("./sections"), exports);
|
|
20
|
+
__exportStar(require("./labels"), exports);
|
|
21
|
+
__exportStar(require("./comments"), exports);
|
|
22
|
+
__exportStar(require("./reminders"), exports);
|
|
23
|
+
__exportStar(require("./users"), exports);
|
|
24
|
+
__exportStar(require("./productivity"), exports);
|
|
25
|
+
__exportStar(require("./activity"), exports);
|
|
26
|
+
__exportStar(require("./workspaces"), exports);
|
|
27
|
+
__exportStar(require("./insights"), exports);
|
|
28
|
+
__exportStar(require("./backups"), exports);
|
|
29
|
+
__exportStar(require("./id-mappings"), exports);
|
|
30
|
+
__exportStar(require("./emails"), exports);
|
|
31
|
+
__exportStar(require("./uploads"), exports);
|
|
32
|
+
__exportStar(require("./templates"), exports);
|
|
18
33
|
__exportStar(require("./errors"), exports);
|
|
19
|
-
__exportStar(require("./requests"), exports);
|
|
20
34
|
__exportStar(require("./http"), exports);
|
|
21
35
|
__exportStar(require("./sync"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
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;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.DayActivitySchema = zod_1.z.object({
|
|
6
|
+
date: zod_1.z.string(),
|
|
7
|
+
totalCount: zod_1.z.number().int(),
|
|
8
|
+
});
|
|
9
|
+
exports.WeekRollupSchema = zod_1.z.object({
|
|
10
|
+
fromDate: zod_1.z.string(),
|
|
11
|
+
toDate: zod_1.z.string(),
|
|
12
|
+
totalCount: zod_1.z.number().int(),
|
|
13
|
+
});
|
|
14
|
+
exports.ProjectActivityStatsSchema = zod_1.z.object({
|
|
15
|
+
dayItems: zod_1.z.array(exports.DayActivitySchema),
|
|
16
|
+
weekItems: zod_1.z.array(exports.WeekRollupSchema).nullable(),
|
|
17
|
+
});
|
|
18
|
+
/** Available project health statuses. */
|
|
19
|
+
exports.HEALTH_STATUSES = [
|
|
20
|
+
'UNKNOWN',
|
|
21
|
+
'ON_TRACK',
|
|
22
|
+
'AT_RISK',
|
|
23
|
+
'CRITICAL',
|
|
24
|
+
'EXCELLENT',
|
|
25
|
+
'ERROR',
|
|
26
|
+
];
|
|
27
|
+
exports.TaskRecommendationSchema = zod_1.z.object({
|
|
28
|
+
taskId: zod_1.z.string(),
|
|
29
|
+
recommendation: zod_1.z.string(),
|
|
30
|
+
});
|
|
31
|
+
exports.ProjectHealthSchema = zod_1.z.object({
|
|
32
|
+
status: zod_1.z.enum(exports.HEALTH_STATUSES),
|
|
33
|
+
description: zod_1.z.string().nullable().optional(),
|
|
34
|
+
descriptionSummary: zod_1.z.string().nullable().optional(),
|
|
35
|
+
taskRecommendations: zod_1.z.array(exports.TaskRecommendationSchema).nullable().optional(),
|
|
36
|
+
projectId: zod_1.z.string().nullable().optional(),
|
|
37
|
+
updatedAt: zod_1.z.string().nullable().optional(),
|
|
38
|
+
isStale: zod_1.z.boolean().default(false),
|
|
39
|
+
updateInProgress: zod_1.z.boolean().default(false),
|
|
40
|
+
});
|
|
41
|
+
exports.ProjectMetricsSchema = zod_1.z.object({
|
|
42
|
+
totalTasks: zod_1.z.number().int(),
|
|
43
|
+
completedTasks: zod_1.z.number().int(),
|
|
44
|
+
overdueTasks: zod_1.z.number().int(),
|
|
45
|
+
tasksCreatedThisWeek: zod_1.z.number().int(),
|
|
46
|
+
tasksCompletedThisWeek: zod_1.z.number().int(),
|
|
47
|
+
averageCompletionTime: zod_1.z.number().nullable(),
|
|
48
|
+
});
|
|
49
|
+
exports.TaskContextSchema = zod_1.z.object({
|
|
50
|
+
id: zod_1.z.string(),
|
|
51
|
+
content: zod_1.z.string(),
|
|
52
|
+
due: zod_1.z.string().nullable().optional(),
|
|
53
|
+
deadline: zod_1.z.string().nullable().optional(),
|
|
54
|
+
priority: zod_1.z.string(),
|
|
55
|
+
isCompleted: zod_1.z.boolean(),
|
|
56
|
+
createdAt: zod_1.z.string(),
|
|
57
|
+
updatedAt: zod_1.z.string(),
|
|
58
|
+
completedAt: zod_1.z.string().nullable(),
|
|
59
|
+
completedByUid: zod_1.z.string().nullable(),
|
|
60
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
61
|
+
});
|
|
62
|
+
exports.ProjectHealthContextSchema = zod_1.z.object({
|
|
63
|
+
projectId: zod_1.z.string(),
|
|
64
|
+
projectName: zod_1.z.string(),
|
|
65
|
+
projectDescription: zod_1.z.string().nullable(),
|
|
66
|
+
projectMetrics: exports.ProjectMetricsSchema,
|
|
67
|
+
tasks: zod_1.z.array(exports.TaskContextSchema),
|
|
68
|
+
language: zod_1.z.string().nullable().optional(),
|
|
69
|
+
});
|
|
70
|
+
exports.ProjectProgressSchema = zod_1.z.object({
|
|
71
|
+
projectId: zod_1.z.string(),
|
|
72
|
+
completedCount: zod_1.z.number().int(),
|
|
73
|
+
activeCount: zod_1.z.number().int(),
|
|
74
|
+
progressPercent: zod_1.z.number().int(),
|
|
75
|
+
});
|
|
76
|
+
exports.ProjectInsightSchema = zod_1.z.object({
|
|
77
|
+
projectId: zod_1.z.string(),
|
|
78
|
+
health: exports.ProjectHealthSchema.nullable(),
|
|
79
|
+
progress: exports.ProjectProgressSchema.nullable(),
|
|
80
|
+
});
|
|
81
|
+
exports.WorkspaceInsightsSchema = zod_1.z.object({
|
|
82
|
+
folderId: zod_1.z.string().nullable(),
|
|
83
|
+
projectInsights: zod_1.z.array(exports.ProjectInsightSchema),
|
|
84
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.LabelSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
order: zod_1.z.number().int().nullable(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
color: zod_1.z.string(),
|
|
10
|
+
isFavorite: zod_1.z.boolean(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColorSchema = exports.ProductivityStatsSchema = exports.KarmaUpdateSchema = exports.ItemsWithDateSchema = exports.CompletedItemSchema = exports.StreakSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.StreakSchema = zod_1.z.object({
|
|
6
|
+
count: zod_1.z.number(),
|
|
7
|
+
start: zod_1.z.string(),
|
|
8
|
+
end: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
exports.CompletedItemSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.string(),
|
|
12
|
+
completed: zod_1.z.number(),
|
|
13
|
+
});
|
|
14
|
+
exports.ItemsWithDateSchema = zod_1.z.object({
|
|
15
|
+
items: zod_1.z.array(exports.CompletedItemSchema),
|
|
16
|
+
totalCompleted: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
exports.KarmaUpdateSchema = zod_1.z.object({
|
|
19
|
+
time: zod_1.z.string(),
|
|
20
|
+
newKarma: zod_1.z.number(),
|
|
21
|
+
positiveKarma: zod_1.z.number(),
|
|
22
|
+
negativeKarma: zod_1.z.number(),
|
|
23
|
+
positiveKarmaReasons: zod_1.z.array(zod_1.z.any()),
|
|
24
|
+
negativeKarmaReasons: zod_1.z.array(zod_1.z.any()),
|
|
25
|
+
});
|
|
26
|
+
exports.ProductivityStatsSchema = zod_1.z.object({
|
|
27
|
+
completedCount: zod_1.z.number(),
|
|
28
|
+
daysItems: zod_1.z.array(exports.ItemsWithDateSchema.extend({
|
|
29
|
+
date: zod_1.z.string(),
|
|
30
|
+
})),
|
|
31
|
+
goals: zod_1.z.object({
|
|
32
|
+
currentDailyStreak: exports.StreakSchema,
|
|
33
|
+
currentWeeklyStreak: exports.StreakSchema,
|
|
34
|
+
dailyGoal: zod_1.z.number(),
|
|
35
|
+
ignoreDays: zod_1.z.array(zod_1.z.number()),
|
|
36
|
+
karmaDisabled: zod_1.z.number(),
|
|
37
|
+
lastDailyStreak: exports.StreakSchema,
|
|
38
|
+
lastWeeklyStreak: exports.StreakSchema,
|
|
39
|
+
maxDailyStreak: exports.StreakSchema,
|
|
40
|
+
maxWeeklyStreak: exports.StreakSchema,
|
|
41
|
+
user: zod_1.z.string(),
|
|
42
|
+
userId: zod_1.z.string(),
|
|
43
|
+
vacationMode: zod_1.z.number(),
|
|
44
|
+
weeklyGoal: zod_1.z.number(),
|
|
45
|
+
}),
|
|
46
|
+
karma: zod_1.z.number(),
|
|
47
|
+
karmaGraphData: zod_1.z.array(zod_1.z.object({
|
|
48
|
+
date: zod_1.z.string(),
|
|
49
|
+
karmaAvg: zod_1.z.number(),
|
|
50
|
+
})),
|
|
51
|
+
karmaLastUpdate: zod_1.z.number(),
|
|
52
|
+
karmaTrend: zod_1.z.string(),
|
|
53
|
+
karmaUpdateReasons: zod_1.z.array(exports.KarmaUpdateSchema),
|
|
54
|
+
projectColors: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
|
55
|
+
weekItems: zod_1.z.array(exports.ItemsWithDateSchema.extend({
|
|
56
|
+
from: zod_1.z.string(),
|
|
57
|
+
to: zod_1.z.string(),
|
|
58
|
+
})),
|
|
59
|
+
});
|
|
60
|
+
exports.ColorSchema = zod_1.z.object({
|
|
61
|
+
/** The key of the color (i.e. 'berry_red') */
|
|
62
|
+
key: zod_1.z.string(),
|
|
63
|
+
/** The display name of the color (i.e. 'Berry Red') */
|
|
64
|
+
displayName: zod_1.z.string(),
|
|
65
|
+
/** The hex value of the color (i.e. '#b8255f') */
|
|
66
|
+
hexValue: zod_1.z.string(),
|
|
67
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROJECT_VIEW_STYLES = exports.WorkspaceProjectSchema = exports.ProjectVisibilitySchema = exports.PROJECT_VISIBILITIES = exports.PersonalProjectSchema = exports.BaseProjectSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
|
+
/**
|
|
7
|
+
* Base schema for all project types in Todoist.
|
|
8
|
+
* Contains common fields shared between personal and workspace projects.
|
|
9
|
+
*/
|
|
10
|
+
exports.BaseProjectSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.string(),
|
|
12
|
+
canAssignTasks: zod_1.z.boolean(),
|
|
13
|
+
childOrder: zod_1.z.number().int(),
|
|
14
|
+
color: zod_1.z.string(),
|
|
15
|
+
createdAt: zod_1.z.string().nullable(),
|
|
16
|
+
isArchived: zod_1.z.boolean(),
|
|
17
|
+
isDeleted: zod_1.z.boolean(),
|
|
18
|
+
isFavorite: zod_1.z.boolean(),
|
|
19
|
+
isFrozen: zod_1.z.boolean(),
|
|
20
|
+
name: zod_1.z.string(),
|
|
21
|
+
updatedAt: zod_1.z.string().nullable(),
|
|
22
|
+
viewStyle: zod_1.z.string(),
|
|
23
|
+
defaultOrder: zod_1.z.number().int(),
|
|
24
|
+
description: zod_1.z.string(),
|
|
25
|
+
isCollapsed: zod_1.z.boolean(),
|
|
26
|
+
isShared: zod_1.z.boolean(),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Schema for personal projects in Todoist.
|
|
30
|
+
*/
|
|
31
|
+
exports.PersonalProjectSchema = exports.BaseProjectSchema.extend({
|
|
32
|
+
parentId: zod_1.z.string().nullable(),
|
|
33
|
+
inboxProject: zod_1.z.boolean().optional().default(false),
|
|
34
|
+
}).transform((data) => {
|
|
35
|
+
return Object.assign(Object.assign({}, data), { url: (0, url_helpers_1.getProjectUrl)(data.id, data.name) });
|
|
36
|
+
});
|
|
37
|
+
/** Available project visibility levels. */
|
|
38
|
+
exports.PROJECT_VISIBILITIES = ['restricted', 'team', 'public'];
|
|
39
|
+
exports.ProjectVisibilitySchema = zod_1.z.enum(exports.PROJECT_VISIBILITIES);
|
|
40
|
+
/**
|
|
41
|
+
* Schema for workspace projects in Todoist.
|
|
42
|
+
*/
|
|
43
|
+
exports.WorkspaceProjectSchema = exports.BaseProjectSchema.extend({
|
|
44
|
+
access: zod_1.z.object({ visibility: exports.ProjectVisibilitySchema }).optional(),
|
|
45
|
+
collaboratorRoleDefault: zod_1.z.string(),
|
|
46
|
+
folderId: zod_1.z.string().nullable(),
|
|
47
|
+
isInviteOnly: zod_1.z.boolean().nullable(),
|
|
48
|
+
isLinkSharingEnabled: zod_1.z.boolean(),
|
|
49
|
+
role: zod_1.z.string().nullable(),
|
|
50
|
+
status: zod_1.z.string(),
|
|
51
|
+
workspaceId: zod_1.z.string(),
|
|
52
|
+
}).transform((data) => {
|
|
53
|
+
return Object.assign(Object.assign({}, data), { url: (0, url_helpers_1.getProjectUrl)(data.id, data.name) });
|
|
54
|
+
});
|
|
55
|
+
/** Available project view styles. */
|
|
56
|
+
exports.PROJECT_VIEW_STYLES = ['list', 'board', 'calendar'];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SectionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
|
+
exports.SectionSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
id: zod_1.z.string(),
|
|
9
|
+
userId: zod_1.z.string(),
|
|
10
|
+
projectId: zod_1.z.string(),
|
|
11
|
+
addedAt: zod_1.z.string(),
|
|
12
|
+
updatedAt: zod_1.z.string(),
|
|
13
|
+
archivedAt: zod_1.z.string().nullable(),
|
|
14
|
+
name: zod_1.z.string(),
|
|
15
|
+
sectionOrder: zod_1.z.number().int(),
|
|
16
|
+
isArchived: zod_1.z.boolean(),
|
|
17
|
+
isDeleted: zod_1.z.boolean(),
|
|
18
|
+
isCollapsed: zod_1.z.boolean(),
|
|
19
|
+
})
|
|
20
|
+
.transform((data) => {
|
|
21
|
+
return Object.assign(Object.assign({}, data), { url: (0, url_helpers_1.getSectionUrl)(data.id, data.name) });
|
|
22
|
+
});
|
|
@@ -12,8 +12,8 @@ exports.PROJECT_STATUSES = [
|
|
|
12
12
|
'COMPLETED',
|
|
13
13
|
'CANCELED',
|
|
14
14
|
];
|
|
15
|
-
var
|
|
16
|
-
Object.defineProperty(exports, "COLLABORATOR_ROLES", { enumerable: true, get: function () { return
|
|
15
|
+
var types_1 = require("../../workspaces/types");
|
|
16
|
+
Object.defineProperty(exports, "COLLABORATOR_ROLES", { enumerable: true, get: function () { return types_1.COLLABORATOR_ROLES; } });
|
|
17
17
|
/** Available reminder notification services. */
|
|
18
18
|
exports.REMINDER_SERVICES = ['default', 'email', 'mobile', 'push', 'no_default'];
|
|
19
19
|
/** Available workspace project sort orders. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CollaboratorStateSchema = exports.COLLABORATOR_STATUSES = exports.CollaboratorSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("../../workspaces/types");
|
|
6
6
|
exports.CollaboratorSchema = zod_1.z
|
|
7
7
|
.object({
|
|
8
8
|
id: zod_1.z.string(),
|
|
@@ -20,6 +20,6 @@ exports.CollaboratorStateSchema = zod_1.z
|
|
|
20
20
|
projectId: zod_1.z.string(),
|
|
21
21
|
state: zod_1.z.enum(exports.COLLABORATOR_STATUSES),
|
|
22
22
|
isDeleted: zod_1.z.boolean(),
|
|
23
|
-
workspaceRole:
|
|
23
|
+
workspaceRole: types_1.WorkspaceRoleSchema.optional(),
|
|
24
24
|
})
|
|
25
25
|
.passthrough();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NoteSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("../../comments/types");
|
|
6
6
|
/**
|
|
7
7
|
* Sync API note (comment) resource.
|
|
8
8
|
* Separate from the REST `CommentSchema` which transforms `itemId` to `taskId`.
|
|
@@ -14,7 +14,7 @@ exports.NoteSchema = zod_1.z
|
|
|
14
14
|
projectId: zod_1.z.string().optional(),
|
|
15
15
|
content: zod_1.z.string(),
|
|
16
16
|
postedAt: zod_1.z.string(),
|
|
17
|
-
fileAttachment:
|
|
17
|
+
fileAttachment: types_1.AttachmentSchema.nullable(),
|
|
18
18
|
postedUid: zod_1.z.string(),
|
|
19
19
|
uidsToNotify: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
20
20
|
reactions: zod_1.z.record(zod_1.z.string(), zod_1.z.array(zod_1.z.string())).nullable(),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReminderSchema = exports.RelativeReminderSchema = exports.AbsoluteReminderSchema = exports.LocationReminderSchema = exports.LOCATION_TRIGGERS = exports.ReminderBaseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("../../tasks/types");
|
|
6
6
|
exports.ReminderBaseSchema = zod_1.z.object({
|
|
7
7
|
id: zod_1.z.string(),
|
|
8
8
|
notifyUid: zod_1.z.string(),
|
|
@@ -22,13 +22,13 @@ exports.LocationReminderSchema = exports.ReminderBaseSchema.extend({
|
|
|
22
22
|
}).passthrough();
|
|
23
23
|
exports.AbsoluteReminderSchema = exports.ReminderBaseSchema.extend({
|
|
24
24
|
type: zod_1.z.literal('absolute'),
|
|
25
|
-
due:
|
|
25
|
+
due: types_1.DueDateSchema,
|
|
26
26
|
isUrgent: zod_1.z.boolean().optional(),
|
|
27
27
|
}).passthrough();
|
|
28
28
|
exports.RelativeReminderSchema = exports.ReminderBaseSchema.extend({
|
|
29
29
|
type: zod_1.z.literal('relative'),
|
|
30
30
|
minuteOffset: zod_1.z.number().int(),
|
|
31
|
-
due:
|
|
31
|
+
due: types_1.DueDateSchema.optional(),
|
|
32
32
|
isUrgent: zod_1.z.boolean().optional(),
|
|
33
33
|
}).passthrough();
|
|
34
34
|
exports.ReminderSchema = zod_1.z.discriminatedUnion('type', [
|