@doist/todoist-api-typescript 7.6.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/todoist-api.js +6 -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/{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 +2 -2
- 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 +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/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 +1 -1
- 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
|
@@ -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', [
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SyncUserSchema = exports.GettingStartedGuideProjectSchema = exports.JoinableWorkspaceSchema = exports.TzInfoSchema = exports.FeaturesSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("../../users/types");
|
|
6
6
|
const user_preferences_1 = require("../user-preferences");
|
|
7
7
|
exports.FeaturesSchema = zod_1.z
|
|
8
8
|
.object({
|
|
@@ -92,7 +92,7 @@ exports.SyncUserSchema = zod_1.z
|
|
|
92
92
|
onboardingSkipped: zod_1.z.boolean().optional(),
|
|
93
93
|
onboardingTeamMode: zod_1.z.boolean().nullable().optional(),
|
|
94
94
|
onboardingUseCases: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
95
|
-
premiumStatus: zod_1.z.enum(
|
|
95
|
+
premiumStatus: zod_1.z.enum(types_1.PREMIUM_STATUSES),
|
|
96
96
|
premiumUntil: zod_1.z.string().nullable(),
|
|
97
97
|
rambleSessionsUsage: zod_1.z
|
|
98
98
|
.object({
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SyncWorkspaceSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const types_1 = require("../../workspaces/types");
|
|
6
6
|
/**
|
|
7
7
|
* Sync API workspace resource.
|
|
8
8
|
*
|
|
@@ -23,9 +23,9 @@ exports.SyncWorkspaceSchema = zod_1.z
|
|
|
23
23
|
createdAt: zod_1.z.string(),
|
|
24
24
|
isDeleted: zod_1.z.boolean(),
|
|
25
25
|
isCollapsed: zod_1.z.boolean(),
|
|
26
|
-
role:
|
|
27
|
-
plan:
|
|
28
|
-
limits:
|
|
26
|
+
role: types_1.WorkspaceRoleSchema,
|
|
27
|
+
plan: types_1.WorkspacePlanSchema,
|
|
28
|
+
limits: types_1.WorkspaceLimitsSchema,
|
|
29
29
|
inviteCode: zod_1.z.string().nullable().optional(),
|
|
30
30
|
isLinkSharingEnabled: zod_1.z.boolean().nullable().optional(),
|
|
31
31
|
isGuestAllowed: zod_1.z.boolean().nullable().optional(),
|
|
@@ -51,6 +51,6 @@ exports.SyncWorkspaceSchema = zod_1.z
|
|
|
51
51
|
userIds: zod_1.z.array(zod_1.z.number()),
|
|
52
52
|
})
|
|
53
53
|
.optional(),
|
|
54
|
-
properties:
|
|
54
|
+
properties: types_1.WorkspacePropertiesSchema.optional(),
|
|
55
55
|
})
|
|
56
56
|
.passthrough();
|
|
@@ -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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskSchema = exports.DeadlineSchema = exports.DurationSchema = exports.DURATION_UNITS = exports.DueDateSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
|
+
const uncompletable_helpers_1 = require("../../utils/uncompletable-helpers");
|
|
7
|
+
exports.DueDateSchema = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
isRecurring: zod_1.z.boolean(),
|
|
10
|
+
string: zod_1.z.string(),
|
|
11
|
+
date: zod_1.z.string(),
|
|
12
|
+
})
|
|
13
|
+
.extend({
|
|
14
|
+
datetime: zod_1.z.string().nullable().optional(),
|
|
15
|
+
timezone: zod_1.z.string().nullable().optional(),
|
|
16
|
+
lang: zod_1.z.string().nullable().optional(),
|
|
17
|
+
});
|
|
18
|
+
/** Available duration units for task deadlines. */
|
|
19
|
+
exports.DURATION_UNITS = ['minute', 'day'];
|
|
20
|
+
exports.DurationSchema = zod_1.z.object({
|
|
21
|
+
amount: zod_1.z.number().positive('Value should be greater than zero'),
|
|
22
|
+
unit: zod_1.z.enum(exports.DURATION_UNITS),
|
|
23
|
+
});
|
|
24
|
+
exports.DeadlineSchema = zod_1.z.object({
|
|
25
|
+
date: zod_1.z.string(),
|
|
26
|
+
lang: zod_1.z.string(),
|
|
27
|
+
});
|
|
28
|
+
exports.TaskSchema = zod_1.z
|
|
29
|
+
.object({
|
|
30
|
+
id: zod_1.z.string(),
|
|
31
|
+
userId: zod_1.z.string(),
|
|
32
|
+
projectId: zod_1.z.string(),
|
|
33
|
+
sectionId: zod_1.z.string().nullable(),
|
|
34
|
+
parentId: zod_1.z.string().nullable(),
|
|
35
|
+
addedByUid: zod_1.z.string().nullable(),
|
|
36
|
+
assignedByUid: zod_1.z.string().nullable(),
|
|
37
|
+
responsibleUid: zod_1.z.string().nullable(),
|
|
38
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
39
|
+
deadline: exports.DeadlineSchema.nullable(),
|
|
40
|
+
duration: exports.DurationSchema.nullable(),
|
|
41
|
+
checked: zod_1.z.boolean(),
|
|
42
|
+
isDeleted: zod_1.z.boolean(),
|
|
43
|
+
addedAt: zod_1.z.string().nullable(),
|
|
44
|
+
completedAt: zod_1.z.string().nullable(),
|
|
45
|
+
updatedAt: zod_1.z.string().nullable(),
|
|
46
|
+
due: exports.DueDateSchema.nullable(),
|
|
47
|
+
priority: zod_1.z.number().int(),
|
|
48
|
+
childOrder: zod_1.z.number().int(),
|
|
49
|
+
content: zod_1.z.string(),
|
|
50
|
+
description: zod_1.z.string(),
|
|
51
|
+
dayOrder: zod_1.z.number().int(),
|
|
52
|
+
isCollapsed: zod_1.z.boolean(),
|
|
53
|
+
isUncompletable: zod_1.z.boolean().default(false),
|
|
54
|
+
})
|
|
55
|
+
.transform((data) => {
|
|
56
|
+
// Auto-detect uncompletable status from content prefix
|
|
57
|
+
const isUncompletable = (0, uncompletable_helpers_1.hasUncompletablePrefix)(data.content);
|
|
58
|
+
return Object.assign(Object.assign({}, data), { isUncompletable, url: (0, url_helpers_1.getTaskUrl)(data.id, data.content) });
|
|
59
|
+
});
|
|
@@ -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,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,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,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurrentUserSchema = exports.PREMIUM_STATUSES = exports.TimezoneInfoSchema = exports.UserSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.UserSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
name: zod_1.z.string(),
|
|
8
|
+
email: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
exports.TimezoneInfoSchema = zod_1.z.object({
|
|
11
|
+
gmtString: zod_1.z.string(),
|
|
12
|
+
hours: zod_1.z.number().int(),
|
|
13
|
+
isDst: zod_1.z.number().int(),
|
|
14
|
+
minutes: zod_1.z.number().int(),
|
|
15
|
+
timezone: zod_1.z.string(),
|
|
16
|
+
});
|
|
17
|
+
/** Available user premium statuses. */
|
|
18
|
+
exports.PREMIUM_STATUSES = [
|
|
19
|
+
'not_premium',
|
|
20
|
+
'current_personal_plan',
|
|
21
|
+
'legacy_personal_plan',
|
|
22
|
+
'teams_business_member',
|
|
23
|
+
];
|
|
24
|
+
exports.CurrentUserSchema = zod_1.z.object({
|
|
25
|
+
id: zod_1.z.string(),
|
|
26
|
+
email: zod_1.z.string(),
|
|
27
|
+
fullName: zod_1.z.string(),
|
|
28
|
+
avatarBig: zod_1.z.string().nullish(),
|
|
29
|
+
avatarMedium: zod_1.z.string().nullish(),
|
|
30
|
+
avatarS640: zod_1.z.string().nullish(),
|
|
31
|
+
avatarSmall: zod_1.z.string().nullish(),
|
|
32
|
+
businessAccountId: zod_1.z.string().nullable(),
|
|
33
|
+
isPremium: zod_1.z.boolean(),
|
|
34
|
+
premiumStatus: zod_1.z.enum(exports.PREMIUM_STATUSES),
|
|
35
|
+
dateFormat: zod_1.z.number().int(),
|
|
36
|
+
timeFormat: zod_1.z.number().int(),
|
|
37
|
+
weeklyGoal: zod_1.z.number().int(),
|
|
38
|
+
dailyGoal: zod_1.z.number().int(),
|
|
39
|
+
completedCount: zod_1.z.number().int(),
|
|
40
|
+
completedToday: zod_1.z.number().int(),
|
|
41
|
+
karma: zod_1.z.number(),
|
|
42
|
+
karmaTrend: zod_1.z.string(),
|
|
43
|
+
lang: zod_1.z.string(),
|
|
44
|
+
nextWeek: zod_1.z.number().int(),
|
|
45
|
+
startDay: zod_1.z.number().int(),
|
|
46
|
+
startPage: zod_1.z.string(),
|
|
47
|
+
tzInfo: exports.TimezoneInfoSchema,
|
|
48
|
+
inboxProjectId: zod_1.z.string(),
|
|
49
|
+
daysOff: zod_1.z.array(zod_1.z.number().int()),
|
|
50
|
+
weekendStartDay: zod_1.z.number().int(),
|
|
51
|
+
});
|
|
@@ -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,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkspaceUserTaskSchema = exports.MemberActivityInfoSchema = exports.WorkspaceSchema = exports.WorkspacePropertiesSchema = exports.WorkspaceLimitsSchema = exports.WorkspacePlanSchema = exports.WORKSPACE_PLANS = exports.JoinWorkspaceResultSchema = exports.WorkspacePlanDetailsSchema = exports.WORKSPACE_PLAN_STATUSES = exports.WORKSPACE_CURRENT_PLANS = exports.FormattedPriceListingSchema = exports.PlanPriceSchema = exports.WorkspaceInvitationSchema = exports.WorkspaceUserSchema = exports.WorkspaceRoleSchema = exports.WORKSPACE_ROLES = exports.COLLABORATOR_ROLES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../tasks/types");
|
|
6
|
+
/** Available project collaborator roles. */
|
|
7
|
+
exports.COLLABORATOR_ROLES = [
|
|
8
|
+
'CREATOR',
|
|
9
|
+
'ADMIN',
|
|
10
|
+
'READ_WRITE',
|
|
11
|
+
'EDIT_ONLY',
|
|
12
|
+
'COMPLETE_ONLY',
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Available workspace roles.
|
|
16
|
+
*/
|
|
17
|
+
exports.WORKSPACE_ROLES = ['ADMIN', 'MEMBER', 'GUEST'];
|
|
18
|
+
exports.WorkspaceRoleSchema = zod_1.z.enum(exports.WORKSPACE_ROLES);
|
|
19
|
+
exports.WorkspaceUserSchema = zod_1.z.object({
|
|
20
|
+
userId: zod_1.z.string(),
|
|
21
|
+
workspaceId: zod_1.z.string(),
|
|
22
|
+
userEmail: zod_1.z.string(),
|
|
23
|
+
fullName: zod_1.z.string(),
|
|
24
|
+
timezone: zod_1.z.string(),
|
|
25
|
+
role: exports.WorkspaceRoleSchema,
|
|
26
|
+
imageId: zod_1.z.string().nullable(),
|
|
27
|
+
isDeleted: zod_1.z.boolean().default(false),
|
|
28
|
+
});
|
|
29
|
+
exports.WorkspaceInvitationSchema = zod_1.z.object({
|
|
30
|
+
id: zod_1.z.string().default('0'),
|
|
31
|
+
inviterId: zod_1.z.string(),
|
|
32
|
+
userEmail: zod_1.z.string(),
|
|
33
|
+
workspaceId: zod_1.z.string(),
|
|
34
|
+
role: exports.WorkspaceRoleSchema,
|
|
35
|
+
isExistingUser: zod_1.z.boolean(),
|
|
36
|
+
});
|
|
37
|
+
exports.PlanPriceSchema = zod_1.z.object({
|
|
38
|
+
currency: zod_1.z.string(),
|
|
39
|
+
amount: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
|
|
40
|
+
interval: zod_1.z.string().optional(),
|
|
41
|
+
});
|
|
42
|
+
exports.FormattedPriceListingSchema = zod_1.z.object({
|
|
43
|
+
currency: zod_1.z.string().optional(),
|
|
44
|
+
amount: zod_1.z.number().optional(),
|
|
45
|
+
interval: zod_1.z.string().optional(),
|
|
46
|
+
formatted: zod_1.z.string().optional(),
|
|
47
|
+
});
|
|
48
|
+
/** Available workspace plan names. */
|
|
49
|
+
exports.WORKSPACE_CURRENT_PLANS = ['Business', 'Starter'];
|
|
50
|
+
/** Available workspace plan statuses. */
|
|
51
|
+
exports.WORKSPACE_PLAN_STATUSES = [
|
|
52
|
+
'Active',
|
|
53
|
+
'Downgraded',
|
|
54
|
+
'Cancelled',
|
|
55
|
+
'NeverSubscribed',
|
|
56
|
+
];
|
|
57
|
+
exports.WorkspacePlanDetailsSchema = zod_1.z.object({
|
|
58
|
+
currentMemberCount: zod_1.z.number(),
|
|
59
|
+
currentPlan: zod_1.z.enum(exports.WORKSPACE_CURRENT_PLANS),
|
|
60
|
+
currentPlanStatus: zod_1.z.enum(exports.WORKSPACE_PLAN_STATUSES),
|
|
61
|
+
downgradeAt: zod_1.z.string().nullable(),
|
|
62
|
+
currentActiveProjects: zod_1.z.number(),
|
|
63
|
+
maximumActiveProjects: zod_1.z.number(),
|
|
64
|
+
priceList: zod_1.z.array(exports.FormattedPriceListingSchema),
|
|
65
|
+
workspaceId: zod_1.z.number(),
|
|
66
|
+
isTrialing: zod_1.z.boolean(),
|
|
67
|
+
trialEndsAt: zod_1.z.string().nullable(),
|
|
68
|
+
cancelAtPeriodEnd: zod_1.z.boolean(),
|
|
69
|
+
hasTrialed: zod_1.z.boolean(),
|
|
70
|
+
planPrice: exports.PlanPriceSchema.nullable(),
|
|
71
|
+
hasBillingPortal: zod_1.z.boolean(),
|
|
72
|
+
hasBillingPortalSwitchToAnnual: zod_1.z.boolean(),
|
|
73
|
+
});
|
|
74
|
+
exports.JoinWorkspaceResultSchema = zod_1.z.object({
|
|
75
|
+
customSortingApplied: zod_1.z.boolean(),
|
|
76
|
+
projectSortPreference: zod_1.z.string(),
|
|
77
|
+
role: exports.WorkspaceRoleSchema,
|
|
78
|
+
userId: zod_1.z.string(),
|
|
79
|
+
workspaceId: zod_1.z.string(),
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Available workspace plans.
|
|
83
|
+
*/
|
|
84
|
+
exports.WORKSPACE_PLANS = ['STARTER', 'BUSINESS'];
|
|
85
|
+
exports.WorkspacePlanSchema = zod_1.z.enum(exports.WORKSPACE_PLANS);
|
|
86
|
+
/**
|
|
87
|
+
* Workspace resource limits.
|
|
88
|
+
*/
|
|
89
|
+
exports.WorkspaceLimitsSchema = zod_1.z
|
|
90
|
+
.object({
|
|
91
|
+
current: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable(),
|
|
92
|
+
next: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable(),
|
|
93
|
+
})
|
|
94
|
+
.catchall(zod_1.z.any());
|
|
95
|
+
/**
|
|
96
|
+
* Workspace properties (flexible object for unknown fields).
|
|
97
|
+
*/
|
|
98
|
+
exports.WorkspacePropertiesSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
99
|
+
/**
|
|
100
|
+
* Represents a workspace in Todoist.
|
|
101
|
+
*/
|
|
102
|
+
exports.WorkspaceSchema = zod_1.z.object({
|
|
103
|
+
id: zod_1.z.string(),
|
|
104
|
+
name: zod_1.z.string(),
|
|
105
|
+
plan: exports.WorkspacePlanSchema,
|
|
106
|
+
role: exports.WorkspaceRoleSchema,
|
|
107
|
+
inviteCode: zod_1.z.string(),
|
|
108
|
+
isLinkSharingEnabled: zod_1.z.boolean(),
|
|
109
|
+
isGuestAllowed: zod_1.z.boolean(),
|
|
110
|
+
limits: exports.WorkspaceLimitsSchema,
|
|
111
|
+
logoBig: zod_1.z.string().nullish(),
|
|
112
|
+
logoMedium: zod_1.z.string().nullish(),
|
|
113
|
+
logoSmall: zod_1.z.string().nullish(),
|
|
114
|
+
logoS640: zod_1.z.string().nullish(),
|
|
115
|
+
createdAt: zod_1.z.string(),
|
|
116
|
+
creatorId: zod_1.z.string(),
|
|
117
|
+
properties: exports.WorkspacePropertiesSchema,
|
|
118
|
+
});
|
|
119
|
+
exports.MemberActivityInfoSchema = zod_1.z.object({
|
|
120
|
+
userId: zod_1.z.string(),
|
|
121
|
+
tasksAssigned: zod_1.z.number().int(),
|
|
122
|
+
tasksOverdue: zod_1.z.number().int(),
|
|
123
|
+
});
|
|
124
|
+
exports.WorkspaceUserTaskSchema = zod_1.z.object({
|
|
125
|
+
id: zod_1.z.string(),
|
|
126
|
+
content: zod_1.z.string(),
|
|
127
|
+
responsibleUid: zod_1.z.string().nullable(),
|
|
128
|
+
due: types_1.DueDateSchema.nullable(),
|
|
129
|
+
deadline: types_1.DeadlineSchema.nullable(),
|
|
130
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
131
|
+
notesCount: zod_1.z.number().int(),
|
|
132
|
+
projectId: zod_1.z.string(),
|
|
133
|
+
projectName: zod_1.z.string(),
|
|
134
|
+
priority: zod_1.z.number().int(),
|
|
135
|
+
description: zod_1.z.string(),
|
|
136
|
+
isOverdue: zod_1.z.boolean(),
|
|
137
|
+
});
|
|
@@ -7,7 +7,18 @@ exports.isPersonalProject = isPersonalProject;
|
|
|
7
7
|
exports.validateProject = validateProject;
|
|
8
8
|
exports.validateProjectArray = validateProjectArray;
|
|
9
9
|
exports.validateWorkspaceUserArray = validateWorkspaceUserArray;
|
|
10
|
-
const
|
|
10
|
+
const types_1 = require("../types/tasks/types");
|
|
11
|
+
const types_2 = require("../types/projects/types");
|
|
12
|
+
const types_3 = require("../types/sections/types");
|
|
13
|
+
const types_4 = require("../types/labels/types");
|
|
14
|
+
const types_5 = require("../types/comments/types");
|
|
15
|
+
const types_6 = require("../types/users/types");
|
|
16
|
+
const types_7 = require("../types/productivity/types");
|
|
17
|
+
const types_8 = require("../types/activity/types");
|
|
18
|
+
const types_9 = require("../types/workspaces/types");
|
|
19
|
+
const types_10 = require("../types/insights/types");
|
|
20
|
+
const types_11 = require("../types/backups/types");
|
|
21
|
+
const types_12 = require("../types/id-mappings/types");
|
|
11
22
|
const resources_1 = require("../types/sync/resources");
|
|
12
23
|
function createValidator(schema) {
|
|
13
24
|
return (input) => schema.parse(input);
|
|
@@ -16,7 +27,7 @@ function createArrayValidator(validateItem) {
|
|
|
16
27
|
return (input) => input.map(validateItem);
|
|
17
28
|
}
|
|
18
29
|
// Entity validators
|
|
19
|
-
exports.validateTask = createValidator(
|
|
30
|
+
exports.validateTask = createValidator(types_1.TaskSchema);
|
|
20
31
|
exports.validateTaskArray = createArrayValidator(exports.validateTask);
|
|
21
32
|
/**
|
|
22
33
|
* Type guard to check if a project is a workspace project.
|
|
@@ -41,53 +52,53 @@ function isPersonalProject(project) {
|
|
|
41
52
|
*/
|
|
42
53
|
function validateProject(input) {
|
|
43
54
|
if ('workspaceId' in input) {
|
|
44
|
-
return
|
|
55
|
+
return types_2.WorkspaceProjectSchema.parse(input);
|
|
45
56
|
}
|
|
46
|
-
return
|
|
57
|
+
return types_2.PersonalProjectSchema.parse(input);
|
|
47
58
|
}
|
|
48
59
|
function validateProjectArray(input) {
|
|
49
60
|
return input.map(validateProject);
|
|
50
61
|
}
|
|
51
|
-
exports.validateSection = createValidator(
|
|
62
|
+
exports.validateSection = createValidator(types_3.SectionSchema);
|
|
52
63
|
exports.validateSectionArray = createArrayValidator(exports.validateSection);
|
|
53
|
-
exports.validateLabel = createValidator(
|
|
64
|
+
exports.validateLabel = createValidator(types_4.LabelSchema);
|
|
54
65
|
exports.validateLabelArray = createArrayValidator(exports.validateLabel);
|
|
55
|
-
exports.validateComment = createValidator(
|
|
66
|
+
exports.validateComment = createValidator(types_5.CommentSchema);
|
|
56
67
|
exports.validateCommentArray = createArrayValidator(exports.validateComment);
|
|
57
|
-
exports.validateUser = createValidator(
|
|
68
|
+
exports.validateUser = createValidator(types_6.UserSchema);
|
|
58
69
|
exports.validateUserArray = createArrayValidator(exports.validateUser);
|
|
59
|
-
exports.validateProductivityStats = createValidator(
|
|
60
|
-
exports.validateCurrentUser = createValidator(
|
|
61
|
-
exports.validateActivityEvent = createValidator(
|
|
70
|
+
exports.validateProductivityStats = createValidator(types_7.ProductivityStatsSchema);
|
|
71
|
+
exports.validateCurrentUser = createValidator(types_6.CurrentUserSchema);
|
|
72
|
+
exports.validateActivityEvent = createValidator(types_8.ActivityEventSchema);
|
|
62
73
|
exports.validateActivityEventArray = createArrayValidator(exports.validateActivityEvent);
|
|
63
|
-
exports.validateAttachment = createValidator(
|
|
64
|
-
exports.validateWorkspaceUser = createValidator(
|
|
74
|
+
exports.validateAttachment = createValidator(types_5.AttachmentSchema);
|
|
75
|
+
exports.validateWorkspaceUser = createValidator(types_9.WorkspaceUserSchema);
|
|
65
76
|
function validateWorkspaceUserArray(input) {
|
|
66
77
|
if (!Array.isArray(input)) {
|
|
67
78
|
throw new Error(`Expected array for workspace users, got ${typeof input}`);
|
|
68
79
|
}
|
|
69
80
|
return input.map(exports.validateWorkspaceUser);
|
|
70
81
|
}
|
|
71
|
-
exports.validateWorkspaceInvitation = createValidator(
|
|
82
|
+
exports.validateWorkspaceInvitation = createValidator(types_9.WorkspaceInvitationSchema);
|
|
72
83
|
exports.validateWorkspaceInvitationArray = createArrayValidator(exports.validateWorkspaceInvitation);
|
|
73
|
-
exports.validateWorkspacePlanDetails = createValidator(
|
|
74
|
-
exports.validateJoinWorkspaceResult = createValidator(
|
|
75
|
-
exports.validateWorkspace = createValidator(
|
|
84
|
+
exports.validateWorkspacePlanDetails = createValidator(types_9.WorkspacePlanDetailsSchema);
|
|
85
|
+
exports.validateJoinWorkspaceResult = createValidator(types_9.JoinWorkspaceResultSchema);
|
|
86
|
+
exports.validateWorkspace = createValidator(types_9.WorkspaceSchema);
|
|
76
87
|
exports.validateWorkspaceArray = createArrayValidator(exports.validateWorkspace);
|
|
77
|
-
exports.validateMemberActivityInfo = createValidator(
|
|
88
|
+
exports.validateMemberActivityInfo = createValidator(types_9.MemberActivityInfoSchema);
|
|
78
89
|
exports.validateMemberActivityInfoArray = createArrayValidator(exports.validateMemberActivityInfo);
|
|
79
|
-
exports.validateWorkspaceUserTask = createValidator(
|
|
90
|
+
exports.validateWorkspaceUserTask = createValidator(types_9.WorkspaceUserTaskSchema);
|
|
80
91
|
exports.validateWorkspaceUserTaskArray = createArrayValidator(exports.validateWorkspaceUserTask);
|
|
81
|
-
exports.validateProjectActivityStats = createValidator(
|
|
82
|
-
exports.validateProjectHealth = createValidator(
|
|
83
|
-
exports.validateProjectHealthContext = createValidator(
|
|
84
|
-
exports.validateProjectProgress = createValidator(
|
|
85
|
-
exports.validateWorkspaceInsights = createValidator(
|
|
86
|
-
exports.validateBackup = createValidator(
|
|
92
|
+
exports.validateProjectActivityStats = createValidator(types_10.ProjectActivityStatsSchema);
|
|
93
|
+
exports.validateProjectHealth = createValidator(types_10.ProjectHealthSchema);
|
|
94
|
+
exports.validateProjectHealthContext = createValidator(types_10.ProjectHealthContextSchema);
|
|
95
|
+
exports.validateProjectProgress = createValidator(types_10.ProjectProgressSchema);
|
|
96
|
+
exports.validateWorkspaceInsights = createValidator(types_10.WorkspaceInsightsSchema);
|
|
97
|
+
exports.validateBackup = createValidator(types_11.BackupSchema);
|
|
87
98
|
exports.validateBackupArray = createArrayValidator(exports.validateBackup);
|
|
88
|
-
exports.validateIdMapping = createValidator(
|
|
99
|
+
exports.validateIdMapping = createValidator(types_12.IdMappingSchema);
|
|
89
100
|
exports.validateIdMappingArray = createArrayValidator(exports.validateIdMapping);
|
|
90
|
-
exports.validateMovedId = createValidator(
|
|
101
|
+
exports.validateMovedId = createValidator(types_12.MovedIdSchema);
|
|
91
102
|
exports.validateMovedIdArray = createArrayValidator(exports.validateMovedId);
|
|
92
103
|
// Sync resource validators
|
|
93
104
|
exports.validateFilter = createValidator(resources_1.FilterSchema);
|