@doist/todoist-sdk 14.2.0 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/url-helpers.js +151 -23
- package/dist/types/utils/index.d.ts +2 -1
- package/dist/types/utils/url-helpers.d.ts +88 -0
- package/package.json +5 -10
- package/dist/cjs/authentication.js +0 -317
- package/dist/cjs/clients/activity-client.js +0 -63
- package/dist/cjs/clients/app-client.js +0 -345
- package/dist/cjs/clients/backup-client.js +0 -47
- package/dist/cjs/clients/base-client.js +0 -31
- package/dist/cjs/clients/billing-client.js +0 -152
- package/dist/cjs/clients/comment-client.js +0 -91
- package/dist/cjs/clients/email-client.js +0 -43
- package/dist/cjs/clients/folder-client.js +0 -79
- package/dist/cjs/clients/id-mapping-client.js +0 -39
- package/dist/cjs/clients/insights-client.js +0 -87
- package/dist/cjs/clients/label-client.js +0 -126
- package/dist/cjs/clients/productivity-client.js +0 -27
- package/dist/cjs/clients/project-client.js +0 -235
- package/dist/cjs/clients/reminder-client.js +0 -198
- package/dist/cjs/clients/section-client.js +0 -117
- package/dist/cjs/clients/task-client.js +0 -254
- package/dist/cjs/clients/template-client.js +0 -88
- package/dist/cjs/clients/ui-extension-client.js +0 -107
- package/dist/cjs/clients/upload-client.js +0 -155
- package/dist/cjs/clients/view-options-client.js +0 -25
- package/dist/cjs/clients/workspace-client.js +0 -366
- package/dist/cjs/consts/endpoints.js +0 -224
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/test-utils/asserts.js +0 -11
- package/dist/cjs/test-utils/msw-setup.js +0 -97
- package/dist/cjs/test-utils/obsidian-fetch-adapter.js +0 -54
- package/dist/cjs/test-utils/test-defaults.js +0 -371
- package/dist/cjs/test-utils/transport-seam.js +0 -17
- package/dist/cjs/test-utils/webhook-fixtures.js +0 -32
- package/dist/cjs/todoist-api.js +0 -1711
- package/dist/cjs/transport/fetch-with-retry.js +0 -219
- package/dist/cjs/transport/http-client.js +0 -134
- package/dist/cjs/transport/http-dispatcher.js +0 -198
- package/dist/cjs/transport/sync-request.js +0 -83
- package/dist/cjs/types/activity/index.js +0 -18
- package/dist/cjs/types/activity/requests.js +0 -2
- package/dist/cjs/types/activity/types.js +0 -28
- package/dist/cjs/types/apps/index.js +0 -18
- package/dist/cjs/types/apps/requests.js +0 -2
- package/dist/cjs/types/apps/types.js +0 -254
- package/dist/cjs/types/backups/index.js +0 -18
- package/dist/cjs/types/backups/requests.js +0 -2
- package/dist/cjs/types/backups/types.js +0 -8
- package/dist/cjs/types/billing/index.js +0 -18
- package/dist/cjs/types/billing/requests.js +0 -2
- package/dist/cjs/types/billing/types.js +0 -92
- package/dist/cjs/types/comments/index.js +0 -18
- package/dist/cjs/types/comments/requests.js +0 -2
- package/dist/cjs/types/comments/types.js +0 -60
- package/dist/cjs/types/common.js +0 -10
- package/dist/cjs/types/emails/index.js +0 -17
- package/dist/cjs/types/emails/requests.js +0 -5
- package/dist/cjs/types/errors.js +0 -29
- package/dist/cjs/types/folders/index.js +0 -17
- package/dist/cjs/types/folders/requests.js +0 -2
- package/dist/cjs/types/http.js +0 -24
- package/dist/cjs/types/id-mappings/index.js +0 -18
- package/dist/cjs/types/id-mappings/requests.js +0 -20
- package/dist/cjs/types/id-mappings/types.js +0 -12
- package/dist/cjs/types/index.js +0 -40
- package/dist/cjs/types/insights/index.js +0 -18
- package/dist/cjs/types/insights/requests.js +0 -2
- package/dist/cjs/types/insights/types.js +0 -80
- package/dist/cjs/types/labels/index.js +0 -18
- package/dist/cjs/types/labels/requests.js +0 -2
- package/dist/cjs/types/labels/types.js +0 -11
- package/dist/cjs/types/productivity/index.js +0 -17
- package/dist/cjs/types/productivity/types.js +0 -68
- package/dist/cjs/types/projects/index.js +0 -18
- package/dist/cjs/types/projects/requests.js +0 -2
- package/dist/cjs/types/projects/types.js +0 -66
- package/dist/cjs/types/reminders/index.js +0 -17
- package/dist/cjs/types/reminders/requests.js +0 -95
- package/dist/cjs/types/sections/index.js +0 -18
- package/dist/cjs/types/sections/requests.js +0 -2
- package/dist/cjs/types/sections/types.js +0 -25
- package/dist/cjs/types/sync/commands/calendars.js +0 -2
- package/dist/cjs/types/sync/commands/filters.js +0 -2
- package/dist/cjs/types/sync/commands/folders.js +0 -2
- package/dist/cjs/types/sync/commands/index.js +0 -34
- package/dist/cjs/types/sync/commands/labels.js +0 -5
- package/dist/cjs/types/sync/commands/notes.js +0 -2
- package/dist/cjs/types/sync/commands/notifications.js +0 -2
- package/dist/cjs/types/sync/commands/others.js +0 -2
- package/dist/cjs/types/sync/commands/project-view-options.js +0 -2
- package/dist/cjs/types/sync/commands/projects.js +0 -2
- package/dist/cjs/types/sync/commands/reminders.js +0 -2
- package/dist/cjs/types/sync/commands/sections.js +0 -2
- package/dist/cjs/types/sync/commands/shared.js +0 -20
- package/dist/cjs/types/sync/commands/sharing.js +0 -2
- package/dist/cjs/types/sync/commands/tasks.js +0 -2
- package/dist/cjs/types/sync/commands/view-options.js +0 -2
- package/dist/cjs/types/sync/commands/workspace-filters.js +0 -2
- package/dist/cjs/types/sync/commands/workspaces.js +0 -2
- package/dist/cjs/types/sync/index.js +0 -22
- package/dist/cjs/types/sync/request.js +0 -2
- package/dist/cjs/types/sync/resource-types.js +0 -39
- package/dist/cjs/types/sync/resources/calendars.js +0 -27
- package/dist/cjs/types/sync/resources/collaborators.js +0 -21
- package/dist/cjs/types/sync/resources/completed-info.js +0 -24
- package/dist/cjs/types/sync/resources/filters.js +0 -14
- package/dist/cjs/types/sync/resources/folders.js +0 -12
- package/dist/cjs/types/sync/resources/index.js +0 -32
- package/dist/cjs/types/sync/resources/live-notifications.js +0 -38
- package/dist/cjs/types/sync/resources/notes.js +0 -21
- package/dist/cjs/types/sync/resources/reminders.js +0 -50
- package/dist/cjs/types/sync/resources/suggestions.js +0 -36
- package/dist/cjs/types/sync/resources/tooltips.js +0 -8
- package/dist/cjs/types/sync/resources/user-plan-limits.js +0 -20
- package/dist/cjs/types/sync/resources/user-settings.js +0 -40
- package/dist/cjs/types/sync/resources/user.js +0 -110
- package/dist/cjs/types/sync/resources/view-options.js +0 -86
- package/dist/cjs/types/sync/resources/workspace-filters.js +0 -19
- package/dist/cjs/types/sync/resources/workspaces.js +0 -72
- package/dist/cjs/types/sync/response.js +0 -54
- package/dist/cjs/types/sync/user-preferences.js +0 -71
- package/dist/cjs/types/tasks/index.js +0 -18
- package/dist/cjs/types/tasks/requests.js +0 -2
- package/dist/cjs/types/tasks/types.js +0 -59
- package/dist/cjs/types/templates/index.js +0 -17
- package/dist/cjs/types/templates/requests.js +0 -2
- package/dist/cjs/types/ui-extensions/index.js +0 -18
- package/dist/cjs/types/ui-extensions/requests.js +0 -2
- package/dist/cjs/types/ui-extensions/types.js +0 -77
- package/dist/cjs/types/uploads/index.js +0 -17
- package/dist/cjs/types/uploads/requests.js +0 -2
- package/dist/cjs/types/users/index.js +0 -17
- package/dist/cjs/types/users/types.js +0 -51
- package/dist/cjs/types/webhooks/comments.js +0 -96
- package/dist/cjs/types/webhooks/envelope.js +0 -26
- package/dist/cjs/types/webhooks/filters.js +0 -30
- package/dist/cjs/types/webhooks/index.js +0 -25
- package/dist/cjs/types/webhooks/labels.js +0 -54
- package/dist/cjs/types/webhooks/projects.js +0 -36
- package/dist/cjs/types/webhooks/reminders.js +0 -35
- package/dist/cjs/types/webhooks/sections.js +0 -53
- package/dist/cjs/types/webhooks/tasks.js +0 -68
- package/dist/cjs/types/webhooks/types.js +0 -55
- package/dist/cjs/types/workspaces/index.js +0 -18
- package/dist/cjs/types/workspaces/requests.js +0 -2
- package/dist/cjs/types/workspaces/types.js +0 -154
- package/dist/cjs/utils/activity-helpers.js +0 -58
- package/dist/cjs/utils/case-conversion.js +0 -69
- package/dist/cjs/utils/colors.js +0 -143
- package/dist/cjs/utils/file-response.js +0 -32
- package/dist/cjs/utils/headers.js +0 -16
- package/dist/cjs/utils/index.js +0 -31
- package/dist/cjs/utils/multipart-upload.js +0 -293
- package/dist/cjs/utils/processing-helpers.js +0 -18
- package/dist/cjs/utils/project-helpers.js +0 -20
- package/dist/cjs/utils/request-helpers.js +0 -21
- package/dist/cjs/utils/sanitization.js +0 -116
- package/dist/cjs/utils/sync-helpers.js +0 -22
- package/dist/cjs/utils/task-sorting.js +0 -281
- package/dist/cjs/utils/uncompletable-helpers.js +0 -60
- package/dist/cjs/utils/url-helpers.js +0 -74
- package/dist/cjs/utils/validators.js +0 -108
- package/dist/cjs/utils/view-options.js +0 -19
- package/dist/cjs/utils/webhook-parser.js +0 -60
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectViewOptionsDefaultsSchema = exports.ViewOptionsSchema = exports.CalendarSettingsSchema = exports.CALENDAR_COLORS = exports.CALENDAR_LAYOUTS = exports.SortOrderSchema = exports.SORT_ORDERS = exports.SortedBySchema = exports.SORTED_BY_OPTIONS = exports.GroupedBySchema = exports.GROUPED_BY_OPTIONS = exports.ViewModeSchema = exports.VIEW_MODES = exports.ViewTypeSchema = exports.VIEW_TYPES = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/** Available view types. */
|
|
6
|
-
exports.VIEW_TYPES = [
|
|
7
|
-
'TODAY',
|
|
8
|
-
'UPCOMING',
|
|
9
|
-
'PROJECT',
|
|
10
|
-
'LABEL',
|
|
11
|
-
'FILTER',
|
|
12
|
-
'WORKSPACE_FILTER',
|
|
13
|
-
'SEARCH',
|
|
14
|
-
'TEMPLATE_PREVIEW',
|
|
15
|
-
'TASK_DETAIL',
|
|
16
|
-
'AUTOMATION',
|
|
17
|
-
'ASSIGNED',
|
|
18
|
-
'OVERDUE',
|
|
19
|
-
'WORKSPACE_OVERVIEW',
|
|
20
|
-
];
|
|
21
|
-
exports.ViewTypeSchema = zod_1.z.enum(exports.VIEW_TYPES);
|
|
22
|
-
/** Available view modes. */
|
|
23
|
-
exports.VIEW_MODES = ['LIST', 'BOARD', 'CALENDAR'];
|
|
24
|
-
exports.ViewModeSchema = zod_1.z.enum(exports.VIEW_MODES);
|
|
25
|
-
/** Available grouping options. */
|
|
26
|
-
exports.GROUPED_BY_OPTIONS = [
|
|
27
|
-
'ASSIGNEE',
|
|
28
|
-
'ADDED_DATE',
|
|
29
|
-
'DUE_DATE',
|
|
30
|
-
'DEADLINE',
|
|
31
|
-
'LABEL',
|
|
32
|
-
'PRIORITY',
|
|
33
|
-
'PROJECT',
|
|
34
|
-
'WORKSPACE',
|
|
35
|
-
];
|
|
36
|
-
exports.GroupedBySchema = zod_1.z.enum(exports.GROUPED_BY_OPTIONS).nullable();
|
|
37
|
-
/** Available sorting options. */
|
|
38
|
-
exports.SORTED_BY_OPTIONS = [
|
|
39
|
-
'MANUAL',
|
|
40
|
-
'ALPHABETICALLY',
|
|
41
|
-
'ASSIGNEE',
|
|
42
|
-
'DUE_DATE',
|
|
43
|
-
'DEADLINE',
|
|
44
|
-
'ADDED_DATE',
|
|
45
|
-
'PRIORITY',
|
|
46
|
-
'PROJECT',
|
|
47
|
-
'WORKSPACE',
|
|
48
|
-
];
|
|
49
|
-
exports.SortedBySchema = zod_1.z.enum(exports.SORTED_BY_OPTIONS).nullable();
|
|
50
|
-
/** Available sort directions. */
|
|
51
|
-
exports.SORT_ORDERS = ['ASC', 'DESC'];
|
|
52
|
-
exports.SortOrderSchema = zod_1.z.enum(exports.SORT_ORDERS).nullable();
|
|
53
|
-
/** Available calendar layout modes. */
|
|
54
|
-
exports.CALENDAR_LAYOUTS = ['WEEK', 'MONTH'];
|
|
55
|
-
/** Available task color sources for calendar views. */
|
|
56
|
-
exports.CALENDAR_COLORS = ['PRIORITY', 'LABEL', 'PROJECT'];
|
|
57
|
-
exports.CalendarSettingsSchema = zod_1.z.looseObject({
|
|
58
|
-
layout: zod_1.z.enum(exports.CALENDAR_LAYOUTS).nullable().optional(),
|
|
59
|
-
visibleDayCount: zod_1.z
|
|
60
|
-
.union([zod_1.z.literal(1), zod_1.z.literal(3), zod_1.z.literal(7)])
|
|
61
|
-
.nullable()
|
|
62
|
-
.optional(),
|
|
63
|
-
color: zod_1.z.enum(exports.CALENDAR_COLORS).nullable().optional(),
|
|
64
|
-
});
|
|
65
|
-
exports.ViewOptionsSchema = zod_1.z.looseObject({
|
|
66
|
-
viewType: exports.ViewTypeSchema,
|
|
67
|
-
objectId: zod_1.z.string().nullable().optional(),
|
|
68
|
-
groupedBy: exports.GroupedBySchema.optional(),
|
|
69
|
-
filteredBy: zod_1.z.string().nullable().optional(),
|
|
70
|
-
viewMode: exports.ViewModeSchema.nullable().optional(),
|
|
71
|
-
showCompletedTasks: zod_1.z.boolean().optional(),
|
|
72
|
-
sortedBy: exports.SortedBySchema.optional(),
|
|
73
|
-
sortOrder: exports.SortOrderSchema.optional(),
|
|
74
|
-
calendarSettings: exports.CalendarSettingsSchema.nullable().optional(),
|
|
75
|
-
isDeleted: zod_1.z.boolean().optional(),
|
|
76
|
-
});
|
|
77
|
-
exports.ProjectViewOptionsDefaultsSchema = zod_1.z.looseObject({
|
|
78
|
-
projectId: zod_1.z.string(),
|
|
79
|
-
viewMode: exports.ViewModeSchema.nullable().optional(),
|
|
80
|
-
groupedBy: exports.GroupedBySchema.optional(),
|
|
81
|
-
sortedBy: exports.SortedBySchema.optional(),
|
|
82
|
-
sortOrder: exports.SortOrderSchema.optional(),
|
|
83
|
-
showCompletedTasks: zod_1.z.boolean().optional(),
|
|
84
|
-
filteredBy: zod_1.z.string().nullable().optional(),
|
|
85
|
-
calendarSettings: exports.CalendarSettingsSchema.nullable().optional(),
|
|
86
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkspaceFilterSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.WorkspaceFilterSchema = zod_1.z.looseObject({
|
|
6
|
-
id: zod_1.z.string(),
|
|
7
|
-
workspaceId: zod_1.z.string(),
|
|
8
|
-
name: zod_1.z.string(),
|
|
9
|
-
query: zod_1.z.string(),
|
|
10
|
-
color: zod_1.z.string(),
|
|
11
|
-
itemOrder: zod_1.z.number().int(),
|
|
12
|
-
isDeleted: zod_1.z.boolean(),
|
|
13
|
-
isFavorite: zod_1.z.boolean(),
|
|
14
|
-
isFrozen: zod_1.z.boolean(),
|
|
15
|
-
creatorUid: zod_1.z.string(),
|
|
16
|
-
updaterUid: zod_1.z.string(),
|
|
17
|
-
createdAt: zod_1.z.coerce.date(),
|
|
18
|
-
updatedAt: zod_1.z.coerce.date(),
|
|
19
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
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.SyncWorkspaceSchema = void 0;
|
|
15
|
-
const zod_1 = require("zod");
|
|
16
|
-
const common_1 = require("../../common");
|
|
17
|
-
const types_1 = require("../../workspaces/types");
|
|
18
|
-
/**
|
|
19
|
-
* Sync API workspace resource.
|
|
20
|
-
*
|
|
21
|
-
* This is a superset of the REST `WorkspaceSchema` — the Sync API returns
|
|
22
|
-
* additional fields like description, isDeleted, isCollapsed, member counts,
|
|
23
|
-
* domain settings, and sorting preferences.
|
|
24
|
-
*/
|
|
25
|
-
exports.SyncWorkspaceSchema = zod_1.z
|
|
26
|
-
.looseObject({
|
|
27
|
-
id: common_1.StringOrNumberSchema,
|
|
28
|
-
name: zod_1.z.string(),
|
|
29
|
-
description: zod_1.z.string(),
|
|
30
|
-
logoBig: zod_1.z.string().nullish(),
|
|
31
|
-
logoMedium: zod_1.z.string().nullish(),
|
|
32
|
-
logoSmall: zod_1.z.string().nullish(),
|
|
33
|
-
logoS640: zod_1.z.string().nullish(),
|
|
34
|
-
creatorId: common_1.StringOrNumberSchema,
|
|
35
|
-
createdAt: zod_1.z.coerce.date().optional(),
|
|
36
|
-
dateCreated: zod_1.z.coerce.date().optional(),
|
|
37
|
-
isDeleted: zod_1.z.boolean(),
|
|
38
|
-
isCollapsed: zod_1.z.boolean(),
|
|
39
|
-
role: types_1.WorkspaceRoleSchema.optional(),
|
|
40
|
-
plan: types_1.WorkspacePlanSchema,
|
|
41
|
-
limits: types_1.WorkspaceLimitsSchema.optional(),
|
|
42
|
-
inviteCode: zod_1.z.string().nullable().optional(),
|
|
43
|
-
isLinkSharingEnabled: zod_1.z.boolean().nullable().optional(),
|
|
44
|
-
isGuestAllowed: zod_1.z.boolean().nullable().optional(),
|
|
45
|
-
currentActiveProjects: zod_1.z.number().nullable(),
|
|
46
|
-
currentMemberCount: zod_1.z.number().nullable(),
|
|
47
|
-
memberCountByType: zod_1.z
|
|
48
|
-
.object({
|
|
49
|
-
adminCount: zod_1.z.number().int(),
|
|
50
|
-
guestCount: zod_1.z.number().int(),
|
|
51
|
-
memberCount: zod_1.z.number().int(),
|
|
52
|
-
})
|
|
53
|
-
.optional(),
|
|
54
|
-
currentTemplateCount: zod_1.z.number().nullable(),
|
|
55
|
-
pendingInvitations: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
56
|
-
domainName: zod_1.z.string().nullish(),
|
|
57
|
-
domainDiscovery: zod_1.z.boolean().nullish(),
|
|
58
|
-
restrictEmailDomains: zod_1.z.boolean().nullish(),
|
|
59
|
-
adminSortingApplied: zod_1.z.boolean(),
|
|
60
|
-
projectSortPreference: zod_1.z.string().nullish(),
|
|
61
|
-
defaultCollaborators: zod_1.z
|
|
62
|
-
.object({
|
|
63
|
-
predefinedGroupIds: zod_1.z.array(zod_1.z.string()),
|
|
64
|
-
userIds: zod_1.z.array(common_1.StringOrNumberSchema),
|
|
65
|
-
})
|
|
66
|
-
.optional(),
|
|
67
|
-
properties: types_1.WorkspacePropertiesSchema.optional(),
|
|
68
|
-
})
|
|
69
|
-
.transform((_a) => {
|
|
70
|
-
var { dateCreated, createdAt } = _a, rest = __rest(_a, ["dateCreated", "createdAt"]);
|
|
71
|
-
return (Object.assign(Object.assign({}, rest), { createdAt: createdAt !== null && createdAt !== void 0 ? createdAt : dateCreated }));
|
|
72
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SyncResponseSchema = exports.SyncErrorSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const types_1 = require("../labels/types");
|
|
6
|
-
const types_2 = require("../projects/types");
|
|
7
|
-
const types_3 = require("../sections/types");
|
|
8
|
-
const types_4 = require("../tasks/types");
|
|
9
|
-
const types_5 = require("../workspaces/types");
|
|
10
|
-
const resources_1 = require("./resources");
|
|
11
|
-
exports.SyncErrorSchema = zod_1.z.object({
|
|
12
|
-
error: zod_1.z.string(),
|
|
13
|
-
errorCode: zod_1.z.number(),
|
|
14
|
-
errorExtra: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
15
|
-
errorTag: zod_1.z.string(),
|
|
16
|
-
httpCode: zod_1.z.number(),
|
|
17
|
-
});
|
|
18
|
-
exports.SyncResponseSchema = zod_1.z.looseObject({
|
|
19
|
-
syncToken: zod_1.z.string().optional(),
|
|
20
|
-
fullSync: zod_1.z.boolean().optional(),
|
|
21
|
-
syncStatus: zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.literal('ok'), exports.SyncErrorSchema])).optional(),
|
|
22
|
-
tempIdMapping: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
23
|
-
items: zod_1.z.array(types_4.TaskSchema).optional(),
|
|
24
|
-
projects: zod_1.z.array(types_2.ProjectSchema).optional(),
|
|
25
|
-
sections: zod_1.z.array(types_3.SectionSchema).optional(),
|
|
26
|
-
labels: zod_1.z.array(types_1.LabelSchema).optional(),
|
|
27
|
-
notes: zod_1.z.array(resources_1.NoteSchema).optional(),
|
|
28
|
-
projectNotes: zod_1.z.array(resources_1.NoteSchema).optional(),
|
|
29
|
-
filters: zod_1.z.array(resources_1.FilterSchema).optional(),
|
|
30
|
-
reminders: zod_1.z.array(resources_1.ReminderSchema).optional(),
|
|
31
|
-
remindersLocation: zod_1.z.array(resources_1.LocationReminderSchema).optional(),
|
|
32
|
-
locations: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())).optional(),
|
|
33
|
-
user: resources_1.SyncUserSchema.optional(),
|
|
34
|
-
liveNotifications: zod_1.z.array(resources_1.LiveNotificationSchema).optional(),
|
|
35
|
-
collaborators: zod_1.z.array(resources_1.CollaboratorSchema).optional(),
|
|
36
|
-
collaboratorStates: zod_1.z.array(resources_1.CollaboratorStateSchema).optional(),
|
|
37
|
-
userSettings: resources_1.UserSettingsSchema.optional(),
|
|
38
|
-
notificationSettings: zod_1.z.record(zod_1.z.string(), zod_1.z.boolean()).optional(),
|
|
39
|
-
userPlanLimits: resources_1.UserPlanLimitsSchema.optional(),
|
|
40
|
-
completedInfo: zod_1.z.array(resources_1.CompletedInfoSchema).optional(),
|
|
41
|
-
stats: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
42
|
-
workspaces: zod_1.z.array(resources_1.SyncWorkspaceSchema).optional(),
|
|
43
|
-
workspaceUsers: zod_1.z.array(types_5.WorkspaceUserSchema).optional(),
|
|
44
|
-
workspaceFilters: zod_1.z.array(resources_1.WorkspaceFilterSchema).optional(),
|
|
45
|
-
viewOptions: zod_1.z.array(resources_1.ViewOptionsSchema).optional(),
|
|
46
|
-
projectViewOptionsDefaults: zod_1.z.array(resources_1.ProjectViewOptionsDefaultsSchema).optional(),
|
|
47
|
-
roleActions: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())).optional(),
|
|
48
|
-
folders: zod_1.z.array(resources_1.FolderSchema).optional(),
|
|
49
|
-
dayOrders: zod_1.z.record(zod_1.z.string(), zod_1.z.number()).optional(),
|
|
50
|
-
calendars: zod_1.z.array(resources_1.CalendarSchema).optional(),
|
|
51
|
-
calendarAccounts: zod_1.z.array(resources_1.CalendarAccountSchema).optional(),
|
|
52
|
-
suggestions: zod_1.z.array(resources_1.SuggestionSchema).optional(),
|
|
53
|
-
tooltips: resources_1.TooltipsSchema.optional(),
|
|
54
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DayOfWeekSchema = exports.TimeFormatSchema = exports.DateFormatSchema = exports.BooleanFromZeroOneSchema = exports.DAY_OF_WEEK_TO_API = exports.TIME_FORMAT_TO_API = exports.DATE_FORMAT_TO_API = exports.DAY_OF_WEEK_FROM_API = exports.TIME_FORMAT_FROM_API = exports.DATE_FORMAT_FROM_API = exports.DAYS_OF_WEEK = exports.TIME_FORMATS = exports.DATE_FORMATS = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/** Available date format options. */
|
|
6
|
-
exports.DATE_FORMATS = ['DD/MM/YYYY', 'MM/DD/YYYY'];
|
|
7
|
-
/** Available time format options. */
|
|
8
|
-
exports.TIME_FORMATS = ['24h', '12h'];
|
|
9
|
-
/** Available days of the week. */
|
|
10
|
-
exports.DAYS_OF_WEEK = [
|
|
11
|
-
'Monday',
|
|
12
|
-
'Tuesday',
|
|
13
|
-
'Wednesday',
|
|
14
|
-
'Thursday',
|
|
15
|
-
'Friday',
|
|
16
|
-
'Saturday',
|
|
17
|
-
'Sunday',
|
|
18
|
-
];
|
|
19
|
-
exports.DATE_FORMAT_FROM_API = {
|
|
20
|
-
0: 'DD/MM/YYYY',
|
|
21
|
-
1: 'MM/DD/YYYY',
|
|
22
|
-
};
|
|
23
|
-
exports.TIME_FORMAT_FROM_API = {
|
|
24
|
-
0: '24h',
|
|
25
|
-
1: '12h',
|
|
26
|
-
};
|
|
27
|
-
exports.DAY_OF_WEEK_FROM_API = {
|
|
28
|
-
1: 'Monday',
|
|
29
|
-
2: 'Tuesday',
|
|
30
|
-
3: 'Wednesday',
|
|
31
|
-
4: 'Thursday',
|
|
32
|
-
5: 'Friday',
|
|
33
|
-
6: 'Saturday',
|
|
34
|
-
7: 'Sunday',
|
|
35
|
-
};
|
|
36
|
-
exports.DATE_FORMAT_TO_API = {
|
|
37
|
-
'DD/MM/YYYY': 0,
|
|
38
|
-
'MM/DD/YYYY': 1,
|
|
39
|
-
};
|
|
40
|
-
exports.TIME_FORMAT_TO_API = { '24h': 0, '12h': 1 };
|
|
41
|
-
exports.DAY_OF_WEEK_TO_API = {
|
|
42
|
-
Monday: 1,
|
|
43
|
-
Tuesday: 2,
|
|
44
|
-
Wednesday: 3,
|
|
45
|
-
Thursday: 4,
|
|
46
|
-
Friday: 5,
|
|
47
|
-
Saturday: 6,
|
|
48
|
-
Sunday: 7,
|
|
49
|
-
};
|
|
50
|
-
/** Zod read-schema: parse API 0/1 integer, emit boolean */
|
|
51
|
-
exports.BooleanFromZeroOneSchema = zod_1.z
|
|
52
|
-
.union([zod_1.z.literal(0), zod_1.z.literal(1)])
|
|
53
|
-
.transform((v) => v === 1);
|
|
54
|
-
/** Zod read-schemas: parse API numbers, emit descriptive strings */
|
|
55
|
-
exports.DateFormatSchema = zod_1.z
|
|
56
|
-
.union([zod_1.z.literal(0), zod_1.z.literal(1)])
|
|
57
|
-
.transform((v) => exports.DATE_FORMAT_FROM_API[v]);
|
|
58
|
-
exports.TimeFormatSchema = zod_1.z
|
|
59
|
-
.union([zod_1.z.literal(0), zod_1.z.literal(1)])
|
|
60
|
-
.transform((v) => exports.TIME_FORMAT_FROM_API[v]);
|
|
61
|
-
exports.DayOfWeekSchema = zod_1.z
|
|
62
|
-
.union([
|
|
63
|
-
zod_1.z.literal(1),
|
|
64
|
-
zod_1.z.literal(2),
|
|
65
|
-
zod_1.z.literal(3),
|
|
66
|
-
zod_1.z.literal(4),
|
|
67
|
-
zod_1.z.literal(5),
|
|
68
|
-
zod_1.z.literal(6),
|
|
69
|
-
zod_1.z.literal(7),
|
|
70
|
-
])
|
|
71
|
-
.transform((v) => exports.DAY_OF_WEEK_FROM_API[v]);
|
|
@@ -1,18 +0,0 @@
|
|
|
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,59 +0,0 @@
|
|
|
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 uncompletable_helpers_1 = require("../../utils/uncompletable-helpers");
|
|
6
|
-
const url_helpers_1 = require("../../utils/url-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.coerce.date().nullable(),
|
|
44
|
-
completedAt: zod_1.z.coerce.date().nullable(),
|
|
45
|
-
updatedAt: zod_1.z.coerce.date().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
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,18 +0,0 @@
|
|
|
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,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UiExtensionSchema = exports.SettingsExtensionSchema = exports.ComposerExtensionSchema = exports.ContextMenuExtensionSchema = exports.UiExtensionBaseSchema = exports.ComposerExtensionContextSchema = exports.COMPOSER_EXTENSION_CONTEXTS = exports.ContextMenuExtensionContextSchema = exports.CONTEXT_MENU_EXTENSION_CONTEXTS = exports.UI_EXTENSION_TYPES = exports.UiExtensionTypeEnum = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const common_1 = require("../common");
|
|
6
|
-
/**
|
|
7
|
-
* Discriminator values for the UI extension variants.
|
|
8
|
-
* Exposed as an enum-like object because the values are used in `z.literal()`
|
|
9
|
-
* across multiple variant schemas (see AGENTS.md "Discriminated unions" exception).
|
|
10
|
-
*/
|
|
11
|
-
exports.UiExtensionTypeEnum = {
|
|
12
|
-
ContextMenu: 'context-menu',
|
|
13
|
-
Composer: 'composer',
|
|
14
|
-
Settings: 'settings',
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* All UI extension type values.
|
|
18
|
-
*/
|
|
19
|
-
exports.UI_EXTENSION_TYPES = [
|
|
20
|
-
exports.UiExtensionTypeEnum.ContextMenu,
|
|
21
|
-
exports.UiExtensionTypeEnum.Composer,
|
|
22
|
-
exports.UiExtensionTypeEnum.Settings,
|
|
23
|
-
];
|
|
24
|
-
/**
|
|
25
|
-
* Context locations where a context-menu extension can appear.
|
|
26
|
-
*/
|
|
27
|
-
exports.CONTEXT_MENU_EXTENSION_CONTEXTS = ['project', 'task'];
|
|
28
|
-
exports.ContextMenuExtensionContextSchema = zod_1.z.enum(exports.CONTEXT_MENU_EXTENSION_CONTEXTS);
|
|
29
|
-
/**
|
|
30
|
-
* Composer locations where a composer extension can appear.
|
|
31
|
-
*/
|
|
32
|
-
exports.COMPOSER_EXTENSION_CONTEXTS = ['task', 'comment'];
|
|
33
|
-
exports.ComposerExtensionContextSchema = zod_1.z.enum(exports.COMPOSER_EXTENSION_CONTEXTS);
|
|
34
|
-
/**
|
|
35
|
-
* Shared fields across all UI extension variants.
|
|
36
|
-
*/
|
|
37
|
-
exports.UiExtensionBaseSchema = zod_1.z.object({
|
|
38
|
-
id: common_1.StringOrNumberSchema,
|
|
39
|
-
integrationId: common_1.StringOrNumberSchema,
|
|
40
|
-
extensionId: zod_1.z.string(),
|
|
41
|
-
url: zod_1.z.string(),
|
|
42
|
-
icon: zod_1.z.string().nullable(),
|
|
43
|
-
name: zod_1.z.string(),
|
|
44
|
-
description: zod_1.z.string(),
|
|
45
|
-
width: zod_1.z.number().int().nullable(),
|
|
46
|
-
height: zod_1.z.number().int().nullable(),
|
|
47
|
-
defVersion: zod_1.z.number().int(),
|
|
48
|
-
minimumCardistVersion: zod_1.z.string(),
|
|
49
|
-
});
|
|
50
|
-
/**
|
|
51
|
-
* Schema for a context-menu UI extension.
|
|
52
|
-
*/
|
|
53
|
-
exports.ContextMenuExtensionSchema = exports.UiExtensionBaseSchema.extend({
|
|
54
|
-
extensionType: zod_1.z.literal(exports.UiExtensionTypeEnum.ContextMenu),
|
|
55
|
-
contextType: exports.ContextMenuExtensionContextSchema,
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* Schema for a composer UI extension.
|
|
59
|
-
*/
|
|
60
|
-
exports.ComposerExtensionSchema = exports.UiExtensionBaseSchema.extend({
|
|
61
|
-
extensionType: zod_1.z.literal(exports.UiExtensionTypeEnum.Composer),
|
|
62
|
-
composerType: exports.ComposerExtensionContextSchema,
|
|
63
|
-
});
|
|
64
|
-
/**
|
|
65
|
-
* Schema for a settings UI extension.
|
|
66
|
-
*/
|
|
67
|
-
exports.SettingsExtensionSchema = exports.UiExtensionBaseSchema.extend({
|
|
68
|
-
extensionType: zod_1.z.literal(exports.UiExtensionTypeEnum.Settings),
|
|
69
|
-
});
|
|
70
|
-
/**
|
|
71
|
-
* Discriminated union of all UI extension variants.
|
|
72
|
-
*/
|
|
73
|
-
exports.UiExtensionSchema = zod_1.z.discriminatedUnion('extensionType', [
|
|
74
|
-
exports.ContextMenuExtensionSchema,
|
|
75
|
-
exports.ComposerExtensionSchema,
|
|
76
|
-
exports.SettingsExtensionSchema,
|
|
77
|
-
]);
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
});
|