@doist/todoist-api-typescript 7.6.0 → 7.7.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.
- package/dist/cjs/todoist-api.js +8 -7
- 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/{requests.js → id-mappings/requests.js} +1 -7
- 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/reminders/requests.js +5 -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 +38 -27
- package/dist/esm/todoist-api.js +4 -3
- 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/{requests.js → id-mappings/requests.js} +0 -6
- 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/reminders/requests.js +2 -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 +12 -1
- package/dist/types/test-utils/test-defaults.d.ts +5 -5
- package/dist/types/todoist-api.d.ts +16 -2
- 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 +64 -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/response.d.ts +5 -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 +7 -6
- package/package.json +3 -3
- package/dist/cjs/types/entities.js +0 -552
- package/dist/esm/types/entities.js +0 -548
- package/dist/types/types/entities.d.ts +0 -1211
- package/dist/types/types/requests.d.ts +0 -1188
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -12,9 +12,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.TodoistApi = void 0;
|
|
15
|
-
const
|
|
16
|
-
const reminders_1 = require("./types/
|
|
17
|
-
const
|
|
15
|
+
const tasks_1 = require("./types/tasks");
|
|
16
|
+
const reminders_1 = require("./types/reminders");
|
|
17
|
+
const reminders_2 = require("./types/sync/resources/reminders");
|
|
18
18
|
const http_client_1 = require("./transport/http-client");
|
|
19
19
|
const endpoints_1 = require("./consts/endpoints");
|
|
20
20
|
const validators_1 = require("./utils/validators");
|
|
@@ -87,9 +87,9 @@ function headersToRecord(headers) {
|
|
|
87
87
|
});
|
|
88
88
|
return result;
|
|
89
89
|
}
|
|
90
|
-
const ReminderDeliveryServiceSchema = zod_1.z.enum(
|
|
90
|
+
const ReminderDeliveryServiceSchema = zod_1.z.enum(reminders_1.REMINDER_DELIVERY_SERVICES);
|
|
91
91
|
const ReminderIdSchema = zod_1.z.string();
|
|
92
|
-
const ReminderDueDateSchema =
|
|
92
|
+
const ReminderDueDateSchema = tasks_1.DueDateSchema.pick({
|
|
93
93
|
date: true,
|
|
94
94
|
string: true,
|
|
95
95
|
timezone: true,
|
|
@@ -122,7 +122,7 @@ const UpdateLocationReminderArgsSchema = zod_1.z
|
|
|
122
122
|
name: zod_1.z.string().optional(),
|
|
123
123
|
locLat: zod_1.z.string().optional(),
|
|
124
124
|
locLong: zod_1.z.string().optional(),
|
|
125
|
-
locTrigger: zod_1.z.enum(
|
|
125
|
+
locTrigger: zod_1.z.enum(reminders_2.LOCATION_TRIGGERS).optional(),
|
|
126
126
|
radius: zod_1.z.number().int().optional(),
|
|
127
127
|
})
|
|
128
128
|
.strict()
|
|
@@ -1340,13 +1340,14 @@ class TodoistApi {
|
|
|
1340
1340
|
* @returns A promise that resolves to the created comment.
|
|
1341
1341
|
*/
|
|
1342
1342
|
async addComment(args, requestId) {
|
|
1343
|
+
const { uidsToNotify } = args, rest = __rest(args, ["uidsToNotify"]);
|
|
1343
1344
|
const response = await (0, http_client_1.request)({
|
|
1344
1345
|
httpMethod: 'POST',
|
|
1345
1346
|
baseUri: this.syncApiBase,
|
|
1346
1347
|
relativePath: endpoints_1.ENDPOINT_REST_COMMENTS,
|
|
1347
1348
|
apiToken: this.authToken,
|
|
1348
1349
|
customFetch: this.customFetch,
|
|
1349
|
-
payload:
|
|
1350
|
+
payload: Object.assign(Object.assign({}, rest), (uidsToNotify ? { uidsToNotify: uidsToNotify.join(',') } : {})),
|
|
1350
1351
|
requestId: requestId,
|
|
1351
1352
|
});
|
|
1352
1353
|
return (0, validators_1.validateComment)(response.data);
|
|
@@ -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,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActivityEventSchema = exports.ActivityEventExtraDataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Flexible object containing event-specific data.
|
|
7
|
+
* Uses z.record to accept any properties for forward compatibility.
|
|
8
|
+
*/
|
|
9
|
+
exports.ActivityEventExtraDataSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable();
|
|
10
|
+
/**
|
|
11
|
+
* Activity log event schema. Accepts unknown fields for forward compatibility.
|
|
12
|
+
*/
|
|
13
|
+
exports.ActivityEventSchema = zod_1.z
|
|
14
|
+
.object({
|
|
15
|
+
objectType: zod_1.z.string(),
|
|
16
|
+
objectId: zod_1.z.string(),
|
|
17
|
+
eventType: zod_1.z.string(),
|
|
18
|
+
eventDate: zod_1.z.string(),
|
|
19
|
+
id: zod_1.z
|
|
20
|
+
.union([zod_1.z.string(), zod_1.z.number()])
|
|
21
|
+
.transform((val) => { var _a; return (_a = val === null || val === void 0 ? void 0 : val.toString()) !== null && _a !== void 0 ? _a : null; })
|
|
22
|
+
.nullable(),
|
|
23
|
+
parentProjectId: zod_1.z.string().nullable(),
|
|
24
|
+
parentItemId: zod_1.z.string().nullable(),
|
|
25
|
+
initiatorId: zod_1.z.string().nullable(),
|
|
26
|
+
extraData: exports.ActivityEventExtraDataSchema,
|
|
27
|
+
})
|
|
28
|
+
.catchall(zod_1.z.any());
|
|
@@ -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,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);
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MOVED_ID_OBJECT_TYPES = exports.ID_MAPPING_OBJECT_TYPES =
|
|
4
|
-
/** Available reminder delivery services. */
|
|
5
|
-
exports.REMINDER_DELIVERY_SERVICES = ['email', 'push'];
|
|
6
|
-
// Email forwarding types
|
|
7
|
-
/** Object types that support email forwarding. */
|
|
8
|
-
exports.EMAIL_OBJECT_TYPES = ['project', 'project_comments', 'task'];
|
|
9
|
-
// ID mapping types
|
|
3
|
+
exports.MOVED_ID_OBJECT_TYPES = exports.ID_MAPPING_OBJECT_TYPES = void 0;
|
|
10
4
|
/** Object types that support ID mappings. */
|
|
11
5
|
exports.ID_MAPPING_OBJECT_TYPES = [
|
|
12
6
|
'sections',
|
|
@@ -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);
|