@doist/todoist-sdk 8.4.0-next.1 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/todoist-api.js +5 -0
- package/dist/cjs/types/sync/commands/index.js +0 -1
- package/dist/cjs/types/sync/resource-types.js +0 -1
- package/dist/cjs/types/sync/resources/index.js +0 -1
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/project-helpers.js +20 -0
- package/dist/cjs/utils/validators.js +3 -23
- package/dist/esm/todoist-api.js +5 -0
- package/dist/esm/types/sync/commands/index.js +0 -1
- package/dist/esm/types/sync/resource-types.js +0 -1
- package/dist/esm/types/sync/resources/index.js +0 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/project-helpers.js +16 -0
- package/dist/esm/utils/validators.js +3 -21
- package/dist/types/todoist-api.d.ts +5 -0
- package/dist/types/types/sync/commands/index.d.ts +0 -9
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/index.d.ts +0 -1
- package/dist/types/types/sync/resources/view-options.d.ts +6 -6
- package/dist/types/types/sync/response.d.ts +1 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/project-helpers.d.ts +13 -0
- package/dist/types/utils/validators.d.ts +8 -68
- package/package.json +1 -1
- package/dist/cjs/types/sync/commands/goals.js +0 -2
- package/dist/cjs/types/sync/resources/goals.js +0 -33
- package/dist/esm/types/sync/commands/goals.js +0 -1
- package/dist/esm/types/sync/resources/goals.js +0 -30
- package/dist/types/types/sync/commands/goals.d.ts +0 -33
- package/dist/types/types/sync/resources/goals.d.ts +0 -37
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -632,6 +632,11 @@ class TodoistApi {
|
|
|
632
632
|
/**
|
|
633
633
|
* Deletes a project by its ID.
|
|
634
634
|
*
|
|
635
|
+
* If the project is a workspace project, it must have been
|
|
636
|
+
* archived first before it can be deleted, otherwise calling
|
|
637
|
+
* this function will result in an error. Personal projects can
|
|
638
|
+
* be deleted regardless of their archived status.
|
|
639
|
+
*
|
|
635
640
|
* @param id - The unique identifier of the project to delete.
|
|
636
641
|
* @param requestId - Optional custom identifier for the request.
|
|
637
642
|
* @returns A promise that resolves to `true` if successful.
|
|
@@ -27,7 +27,6 @@ __exportStar(require("./workspaces"), exports);
|
|
|
27
27
|
__exportStar(require("./folders"), exports);
|
|
28
28
|
__exportStar(require("./workspace-filters"), exports);
|
|
29
29
|
__exportStar(require("./workspace-goals"), exports);
|
|
30
|
-
__exportStar(require("./goals"), exports);
|
|
31
30
|
__exportStar(require("./notifications"), exports);
|
|
32
31
|
__exportStar(require("./sharing"), exports);
|
|
33
32
|
__exportStar(require("./view-options"), exports);
|
|
@@ -21,7 +21,6 @@ __exportStar(require("./tooltips"), exports);
|
|
|
21
21
|
__exportStar(require("./notes"), exports);
|
|
22
22
|
__exportStar(require("./workspace-filters"), exports);
|
|
23
23
|
__exportStar(require("./workspace-goals"), exports);
|
|
24
|
-
__exportStar(require("./goals"), exports);
|
|
25
24
|
__exportStar(require("./calendars"), exports);
|
|
26
25
|
__exportStar(require("./reminders"), exports);
|
|
27
26
|
__exportStar(require("./completed-info"), exports);
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -23,3 +23,4 @@ Object.defineProperty(exports, "getProjectUrl", { enumerable: true, get: functio
|
|
|
23
23
|
Object.defineProperty(exports, "getSectionUrl", { enumerable: true, get: function () { return url_helpers_1.getSectionUrl; } });
|
|
24
24
|
var sync_helpers_1 = require("./sync-helpers");
|
|
25
25
|
Object.defineProperty(exports, "createCommand", { enumerable: true, get: function () { return sync_helpers_1.createCommand; } });
|
|
26
|
+
__exportStar(require("./project-helpers"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isWorkspaceProject = isWorkspaceProject;
|
|
4
|
+
exports.isPersonalProject = isPersonalProject;
|
|
5
|
+
/**
|
|
6
|
+
* Type guard to check if a project is a workspace project.
|
|
7
|
+
* @param project The project to check
|
|
8
|
+
* @returns True if the project is a workspace project
|
|
9
|
+
*/
|
|
10
|
+
function isWorkspaceProject(project) {
|
|
11
|
+
return 'workspaceId' in project;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to check if a project is a personal project.
|
|
15
|
+
* @param project The project to check
|
|
16
|
+
* @returns True if the project is a personal project
|
|
17
|
+
*/
|
|
18
|
+
function isPersonalProject(project) {
|
|
19
|
+
return !isWorkspaceProject(project);
|
|
20
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validateTooltips = exports.validateNoteArray = exports.validateNote = exports.validateFolderArray = exports.validateFolder = exports.validateCollaboratorStateArray = exports.validateCollaboratorState = exports.validateCollaboratorArray = exports.validateCollaborator = exports.validateFilterArray = exports.validateFilter = exports.validateMovedIdArray = exports.validateMovedId = exports.validateIdMappingArray = exports.validateIdMapping = exports.validateBackupArray = exports.validateBackup = exports.validateWorkspaceInsights = exports.validateProjectProgress = exports.validateProjectHealthContext = exports.validateProjectHealth = exports.validateProjectActivityStats = exports.validateWorkspaceUserTaskArray = exports.validateWorkspaceUserTask = exports.validateMemberActivityInfoArray = exports.validateMemberActivityInfo = exports.validateWorkspaceArray = exports.validateWorkspace = exports.validateJoinWorkspaceResult = exports.validateWorkspacePlanDetails = exports.validateWorkspaceInvitationArray = exports.validateWorkspaceInvitation = exports.validateWorkspaceUser = exports.validateAttachment = exports.validateActivityEventArray = exports.validateActivityEvent = exports.validateCurrentUser = exports.validateProductivityStats = exports.validateUserArray = exports.validateUser = exports.validateCommentArray = exports.validateComment = exports.validateLabelArray = exports.validateLabel = exports.validateSectionArray = exports.validateSection = exports.validateWorkspaceProjectArray = exports.validateWorkspaceProject = exports.validateTaskArray = exports.validateTask = void 0;
|
|
4
|
-
exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.
|
|
5
|
-
exports.isWorkspaceProject = isWorkspaceProject;
|
|
6
|
-
exports.isPersonalProject = isPersonalProject;
|
|
4
|
+
exports.validateSuggestionArray = exports.validateSuggestion = exports.validateUserSettings = exports.validateSyncUser = exports.validateSyncWorkspaceArray = exports.validateSyncWorkspace = exports.validateLiveNotificationArray = exports.validateLiveNotification = exports.validateUserPlanLimits = exports.validateProjectViewOptionsDefaultsArray = exports.validateProjectViewOptionsDefaults = exports.validateViewOptionsArray = exports.validateViewOptions = exports.validateCompletedInfoArray = exports.validateCompletedInfo = exports.validateLocationReminderArray = exports.validateLocationReminder = exports.validateReminderArray = exports.validateReminder = exports.validateCalendarAccountArray = exports.validateCalendarAccount = exports.validateCalendarArray = exports.validateCalendar = exports.validateWorkspaceGoalArray = exports.validateWorkspaceGoal = exports.validateWorkspaceFilterArray = exports.validateWorkspaceFilter = void 0;
|
|
7
5
|
exports.validateProject = validateProject;
|
|
8
6
|
exports.validateProjectArray = validateProjectArray;
|
|
9
7
|
exports.validateWorkspaceUserArray = validateWorkspaceUserArray;
|
|
@@ -35,22 +33,6 @@ function createArrayValidator(validateItem) {
|
|
|
35
33
|
// Entity validators
|
|
36
34
|
exports.validateTask = createValidator(types_10.TaskSchema);
|
|
37
35
|
exports.validateTaskArray = createArrayValidator(exports.validateTask);
|
|
38
|
-
/**
|
|
39
|
-
* Type guard to check if a project is a workspace project.
|
|
40
|
-
* @param project The project to check
|
|
41
|
-
* @returns True if the project is a workspace project
|
|
42
|
-
*/
|
|
43
|
-
function isWorkspaceProject(project) {
|
|
44
|
-
return 'workspaceId' in project;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Type guard to check if a project is a personal project.
|
|
48
|
-
* @param project The project to check
|
|
49
|
-
* @returns True if the project is a personal project
|
|
50
|
-
*/
|
|
51
|
-
function isPersonalProject(project) {
|
|
52
|
-
return !isWorkspaceProject(project);
|
|
53
|
-
}
|
|
54
36
|
/**
|
|
55
37
|
* Validates and parses a project input.
|
|
56
38
|
* @param input The input to validate
|
|
@@ -125,8 +107,6 @@ exports.validateNoteArray = createArrayValidator(exports.validateNote);
|
|
|
125
107
|
exports.validateTooltips = createValidator(resources_1.TooltipsSchema);
|
|
126
108
|
exports.validateWorkspaceFilter = createValidator(resources_1.WorkspaceFilterSchema);
|
|
127
109
|
exports.validateWorkspaceFilterArray = createArrayValidator(exports.validateWorkspaceFilter);
|
|
128
|
-
exports.validateGoal = createValidator(resources_1.GoalSchema);
|
|
129
|
-
exports.validateGoalArray = createArrayValidator(exports.validateGoal);
|
|
130
110
|
exports.validateWorkspaceGoal = createValidator(resources_1.WorkspaceGoalSchema);
|
|
131
111
|
exports.validateWorkspaceGoalArray = createArrayValidator(exports.validateWorkspaceGoal);
|
|
132
112
|
exports.validateCalendar = createValidator(resources_1.CalendarSchema);
|
|
@@ -153,7 +133,7 @@ exports.validateUserSettings = createValidator(resources_1.UserSettingsSchema);
|
|
|
153
133
|
exports.validateSuggestion = createValidator(resources_1.SuggestionSchema);
|
|
154
134
|
exports.validateSuggestionArray = createArrayValidator(exports.validateSuggestion);
|
|
155
135
|
function parseSyncResponse(raw) {
|
|
156
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
136
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, raw), ('items' in raw ? { items: (0, exports.validateTaskArray)(raw.items) } : {})), ('projects' in raw ? { projects: validateProjectArray(raw.projects) } : {})), ('sections' in raw ? { sections: (0, exports.validateSectionArray)(raw.sections) } : {})), ('labels' in raw ? { labels: (0, exports.validateLabelArray)(raw.labels) } : {})), ('notes' in raw ? { notes: (0, exports.validateNoteArray)(raw.notes) } : {})), ('projectNotes' in raw ? { projectNotes: (0, exports.validateNoteArray)(raw.projectNotes) } : {})), ('filters' in raw ? { filters: (0, exports.validateFilterArray)(raw.filters) } : {})), ('reminders' in raw ? { reminders: (0, exports.validateReminderArray)(raw.reminders) } : {})), ('remindersLocation' in raw
|
|
157
137
|
? { remindersLocation: (0, exports.validateLocationReminderArray)(raw.remindersLocation) }
|
|
158
138
|
: {})), ('user' in raw ? { user: (0, exports.validateSyncUser)(raw.user) } : {})), ('liveNotifications' in raw
|
|
159
139
|
? { liveNotifications: (0, exports.validateLiveNotificationArray)(raw.liveNotifications) }
|
|
@@ -173,7 +153,7 @@ function parseSyncResponse(raw) {
|
|
|
173
153
|
? {
|
|
174
154
|
projectViewOptionsDefaults: (0, exports.validateProjectViewOptionsDefaultsArray)(raw.projectViewOptionsDefaults),
|
|
175
155
|
}
|
|
176
|
-
: {})), ('folders' in raw ? { folders: (0, exports.validateFolderArray)(raw.folders) } : {})), ('
|
|
156
|
+
: {})), ('folders' in raw ? { folders: (0, exports.validateFolderArray)(raw.folders) } : {})), ('workspaceGoals' in raw
|
|
177
157
|
? { workspaceGoals: (0, exports.validateWorkspaceGoalArray)(raw.workspaceGoals) }
|
|
178
158
|
: {})), ('calendars' in raw ? { calendars: (0, exports.validateCalendarArray)(raw.calendars) } : {})), ('calendarAccounts' in raw
|
|
179
159
|
? { calendarAccounts: (0, exports.validateCalendarAccountArray)(raw.calendarAccounts) }
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -629,6 +629,11 @@ export class TodoistApi {
|
|
|
629
629
|
/**
|
|
630
630
|
* Deletes a project by its ID.
|
|
631
631
|
*
|
|
632
|
+
* If the project is a workspace project, it must have been
|
|
633
|
+
* archived first before it can be deleted, otherwise calling
|
|
634
|
+
* this function will result in an error. Personal projects can
|
|
635
|
+
* be deleted regardless of their archived status.
|
|
636
|
+
*
|
|
632
637
|
* @param id - The unique identifier of the project to delete.
|
|
633
638
|
* @param requestId - Optional custom identifier for the request.
|
|
634
639
|
* @returns A promise that resolves to `true` if successful.
|
|
@@ -11,7 +11,6 @@ export * from './workspaces.js';
|
|
|
11
11
|
export * from './folders.js';
|
|
12
12
|
export * from './workspace-filters.js';
|
|
13
13
|
export * from './workspace-goals.js';
|
|
14
|
-
export * from './goals.js';
|
|
15
14
|
export * from './notifications.js';
|
|
16
15
|
export * from './sharing.js';
|
|
17
16
|
export * from './view-options.js';
|
|
@@ -5,7 +5,6 @@ export * from './tooltips.js';
|
|
|
5
5
|
export * from './notes.js';
|
|
6
6
|
export * from './workspace-filters.js';
|
|
7
7
|
export * from './workspace-goals.js';
|
|
8
|
-
export * from './goals.js';
|
|
9
8
|
export * from './calendars.js';
|
|
10
9
|
export * from './reminders.js';
|
|
11
10
|
export * from './completed-info.js';
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type guard to check if a project is a workspace project.
|
|
3
|
+
* @param project The project to check
|
|
4
|
+
* @returns True if the project is a workspace project
|
|
5
|
+
*/
|
|
6
|
+
export function isWorkspaceProject(project) {
|
|
7
|
+
return 'workspaceId' in project;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Type guard to check if a project is a personal project.
|
|
11
|
+
* @param project The project to check
|
|
12
|
+
* @returns True if the project is a personal project
|
|
13
|
+
*/
|
|
14
|
+
export function isPersonalProject(project) {
|
|
15
|
+
return !isWorkspaceProject(project);
|
|
16
|
+
}
|
|
@@ -10,7 +10,7 @@ import { SectionSchema } from '../types/sections/types.js';
|
|
|
10
10
|
import { TaskSchema } from '../types/tasks/types.js';
|
|
11
11
|
import { UserSchema, CurrentUserSchema } from '../types/users/types.js';
|
|
12
12
|
import { WorkspaceUserSchema, WorkspaceInvitationSchema, WorkspacePlanDetailsSchema, JoinWorkspaceResultSchema, WorkspaceSchema, MemberActivityInfoSchema, WorkspaceUserTaskSchema, } from '../types/workspaces/types.js';
|
|
13
|
-
import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema,
|
|
13
|
+
import { FilterSchema, CollaboratorSchema, CollaboratorStateSchema, FolderSchema, NoteSchema, TooltipsSchema, WorkspaceFilterSchema, WorkspaceGoalSchema, CalendarSchema, CalendarAccountSchema, ReminderSchema, LocationReminderSchema, CompletedInfoSchema, ViewOptionsSchema, ProjectViewOptionsDefaultsSchema, UserPlanLimitsSchema, LiveNotificationSchema, SyncWorkspaceSchema, SyncUserSchema, UserSettingsSchema, SuggestionSchema, } from '../types/sync/resources/index.js';
|
|
14
14
|
function createValidator(schema) {
|
|
15
15
|
return (input) => schema.parse(input);
|
|
16
16
|
}
|
|
@@ -25,22 +25,6 @@ function createArrayValidator(validateItem) {
|
|
|
25
25
|
// Entity validators
|
|
26
26
|
export const validateTask = createValidator(TaskSchema);
|
|
27
27
|
export const validateTaskArray = createArrayValidator(validateTask);
|
|
28
|
-
/**
|
|
29
|
-
* Type guard to check if a project is a workspace project.
|
|
30
|
-
* @param project The project to check
|
|
31
|
-
* @returns True if the project is a workspace project
|
|
32
|
-
*/
|
|
33
|
-
export function isWorkspaceProject(project) {
|
|
34
|
-
return 'workspaceId' in project;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Type guard to check if a project is a personal project.
|
|
38
|
-
* @param project The project to check
|
|
39
|
-
* @returns True if the project is a personal project
|
|
40
|
-
*/
|
|
41
|
-
export function isPersonalProject(project) {
|
|
42
|
-
return !isWorkspaceProject(project);
|
|
43
|
-
}
|
|
44
28
|
/**
|
|
45
29
|
* Validates and parses a project input.
|
|
46
30
|
* @param input The input to validate
|
|
@@ -115,8 +99,6 @@ export const validateNoteArray = createArrayValidator(validateNote);
|
|
|
115
99
|
export const validateTooltips = createValidator(TooltipsSchema);
|
|
116
100
|
export const validateWorkspaceFilter = createValidator(WorkspaceFilterSchema);
|
|
117
101
|
export const validateWorkspaceFilterArray = createArrayValidator(validateWorkspaceFilter);
|
|
118
|
-
export const validateGoal = createValidator(GoalSchema);
|
|
119
|
-
export const validateGoalArray = createArrayValidator(validateGoal);
|
|
120
102
|
export const validateWorkspaceGoal = createValidator(WorkspaceGoalSchema);
|
|
121
103
|
export const validateWorkspaceGoalArray = createArrayValidator(validateWorkspaceGoal);
|
|
122
104
|
export const validateCalendar = createValidator(CalendarSchema);
|
|
@@ -143,7 +125,7 @@ export const validateUserSettings = createValidator(UserSettingsSchema);
|
|
|
143
125
|
export const validateSuggestion = createValidator(SuggestionSchema);
|
|
144
126
|
export const validateSuggestionArray = createArrayValidator(validateSuggestion);
|
|
145
127
|
export function parseSyncResponse(raw) {
|
|
146
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(
|
|
128
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, raw), ('items' in raw ? { items: validateTaskArray(raw.items) } : {})), ('projects' in raw ? { projects: validateProjectArray(raw.projects) } : {})), ('sections' in raw ? { sections: validateSectionArray(raw.sections) } : {})), ('labels' in raw ? { labels: validateLabelArray(raw.labels) } : {})), ('notes' in raw ? { notes: validateNoteArray(raw.notes) } : {})), ('projectNotes' in raw ? { projectNotes: validateNoteArray(raw.projectNotes) } : {})), ('filters' in raw ? { filters: validateFilterArray(raw.filters) } : {})), ('reminders' in raw ? { reminders: validateReminderArray(raw.reminders) } : {})), ('remindersLocation' in raw
|
|
147
129
|
? { remindersLocation: validateLocationReminderArray(raw.remindersLocation) }
|
|
148
130
|
: {})), ('user' in raw ? { user: validateSyncUser(raw.user) } : {})), ('liveNotifications' in raw
|
|
149
131
|
? { liveNotifications: validateLiveNotificationArray(raw.liveNotifications) }
|
|
@@ -163,7 +145,7 @@ export function parseSyncResponse(raw) {
|
|
|
163
145
|
? {
|
|
164
146
|
projectViewOptionsDefaults: validateProjectViewOptionsDefaultsArray(raw.projectViewOptionsDefaults),
|
|
165
147
|
}
|
|
166
|
-
: {})), ('folders' in raw ? { folders: validateFolderArray(raw.folders) } : {})), ('
|
|
148
|
+
: {})), ('folders' in raw ? { folders: validateFolderArray(raw.folders) } : {})), ('workspaceGoals' in raw
|
|
167
149
|
? { workspaceGoals: validateWorkspaceGoalArray(raw.workspaceGoals) }
|
|
168
150
|
: {})), ('calendars' in raw ? { calendars: validateCalendarArray(raw.calendars) } : {})), ('calendarAccounts' in raw
|
|
169
151
|
? { calendarAccounts: validateCalendarAccountArray(raw.calendarAccounts) }
|
|
@@ -259,6 +259,11 @@ export declare class TodoistApi {
|
|
|
259
259
|
/**
|
|
260
260
|
* Deletes a project by its ID.
|
|
261
261
|
*
|
|
262
|
+
* If the project is a workspace project, it must have been
|
|
263
|
+
* archived first before it can be deleted, otherwise calling
|
|
264
|
+
* this function will result in an error. Personal projects can
|
|
265
|
+
* be deleted regardless of their archived status.
|
|
266
|
+
*
|
|
262
267
|
* @param id - The unique identifier of the project to delete.
|
|
263
268
|
* @param requestId - Optional custom identifier for the request.
|
|
264
269
|
* @returns A promise that resolves to `true` if successful.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CalendarUpdateArgs, CalendarAccountUpdateArgs, CalendarAccountRestoreTaskCalendarArgs } from './calendars.js';
|
|
2
2
|
import type { FilterAddArgs, FilterUpdateArgs, FilterUpdateOrdersArgs, FilterDeleteArgs } from './filters.js';
|
|
3
3
|
import type { FolderAddArgs, FolderUpdateArgs, FolderDeleteArgs } from './folders.js';
|
|
4
|
-
import type { GoalAddArgs, GoalUpdateArgs, GoalCompleteArgs, GoalUncompleteArgs, GoalDeleteArgs, GoalLinkItemArgs, GoalUnlinkItemArgs } from './goals.js';
|
|
5
4
|
import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
|
|
6
5
|
import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
|
|
7
6
|
import type { LiveNotificationsMarkUnreadArgs, LiveNotificationsMarkReadArgs, LiveNotificationsMarkReadAllArgs, LiveNotificationsSetLastReadArgs } from './notifications.js';
|
|
@@ -97,13 +96,6 @@ export type SyncCommandsMap = {
|
|
|
97
96
|
workspace_goal_delete: WorkspaceGoalDeleteArgs;
|
|
98
97
|
workspace_goal_project_add: WorkspaceGoalProjectAddArgs;
|
|
99
98
|
workspace_goal_project_remove: WorkspaceGoalProjectRemoveArgs;
|
|
100
|
-
goal_add: GoalAddArgs;
|
|
101
|
-
goal_update: GoalUpdateArgs;
|
|
102
|
-
goal_complete: GoalCompleteArgs;
|
|
103
|
-
goal_uncomplete: GoalUncompleteArgs;
|
|
104
|
-
goal_delete: GoalDeleteArgs;
|
|
105
|
-
goal_link_item: GoalLinkItemArgs;
|
|
106
|
-
goal_unlink_item: GoalUnlinkItemArgs;
|
|
107
99
|
live_notifications_mark_unread: LiveNotificationsMarkUnreadArgs;
|
|
108
100
|
live_notifications_mark_read: LiveNotificationsMarkReadArgs;
|
|
109
101
|
live_notifications_mark_read_all: LiveNotificationsMarkReadAllArgs;
|
|
@@ -171,7 +163,6 @@ export * from './workspaces.js';
|
|
|
171
163
|
export * from './folders.js';
|
|
172
164
|
export * from './workspace-filters.js';
|
|
173
165
|
export * from './workspace-goals.js';
|
|
174
|
-
export * from './goals.js';
|
|
175
166
|
export * from './notifications.js';
|
|
176
167
|
export * from './sharing.js';
|
|
177
168
|
export * from './view-options.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* All available Sync API resource types.
|
|
3
3
|
*/
|
|
4
|
-
export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "
|
|
4
|
+
export declare const SYNC_RESOURCE_TYPES: readonly ["labels", "projects", "items", "notes", "project_notes", "sections", "filters", "reminders", "reminders_location", "locations", "user", "live_notifications", "collaborators", "collaborator_states", "user_settings", "notification_settings", "user_plan_limits", "completed_info", "stats", "workspaces", "workspace_users", "workspace_filters", "view_options", "project_view_options_defaults", "role_actions", "folders", "workspace_goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
|
|
5
5
|
export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
|
|
@@ -5,7 +5,6 @@ export * from './tooltips.js';
|
|
|
5
5
|
export * from './notes.js';
|
|
6
6
|
export * from './workspace-filters.js';
|
|
7
7
|
export * from './workspace-goals.js';
|
|
8
|
-
export * from './goals.js';
|
|
9
8
|
export * from './calendars.js';
|
|
10
9
|
export * from './reminders.js';
|
|
11
10
|
export * from './completed-info.js';
|
|
@@ -33,13 +33,13 @@ export declare const GROUPED_BY_OPTIONS: readonly ["ASSIGNEE", "ADDED_DATE", "DU
|
|
|
33
33
|
export type GroupedBy = (typeof GROUPED_BY_OPTIONS)[number];
|
|
34
34
|
export declare const GroupedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
35
35
|
PROJECT: "PROJECT";
|
|
36
|
-
WORKSPACE: "WORKSPACE";
|
|
37
36
|
LABEL: "LABEL";
|
|
38
37
|
ASSIGNEE: "ASSIGNEE";
|
|
39
38
|
ADDED_DATE: "ADDED_DATE";
|
|
40
39
|
DUE_DATE: "DUE_DATE";
|
|
41
40
|
DEADLINE: "DEADLINE";
|
|
42
41
|
PRIORITY: "PRIORITY";
|
|
42
|
+
WORKSPACE: "WORKSPACE";
|
|
43
43
|
}>>;
|
|
44
44
|
/** Available sorting options. */
|
|
45
45
|
export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "ASSIGNEE", "DUE_DATE", "DEADLINE", "ADDED_DATE", "PRIORITY", "PROJECT", "WORKSPACE"];
|
|
@@ -47,12 +47,12 @@ export declare const SORTED_BY_OPTIONS: readonly ["MANUAL", "ALPHABETICALLY", "A
|
|
|
47
47
|
export type SortedBy = (typeof SORTED_BY_OPTIONS)[number];
|
|
48
48
|
export declare const SortedBySchema: z.ZodNullable<z.ZodEnum<{
|
|
49
49
|
PROJECT: "PROJECT";
|
|
50
|
-
WORKSPACE: "WORKSPACE";
|
|
51
50
|
ASSIGNEE: "ASSIGNEE";
|
|
52
51
|
ADDED_DATE: "ADDED_DATE";
|
|
53
52
|
DUE_DATE: "DUE_DATE";
|
|
54
53
|
DEADLINE: "DEADLINE";
|
|
55
54
|
PRIORITY: "PRIORITY";
|
|
55
|
+
WORKSPACE: "WORKSPACE";
|
|
56
56
|
MANUAL: "MANUAL";
|
|
57
57
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
58
58
|
}>>;
|
|
@@ -93,13 +93,13 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
93
93
|
objectId: z.ZodOptional<z.ZodString>;
|
|
94
94
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
95
95
|
PROJECT: "PROJECT";
|
|
96
|
-
WORKSPACE: "WORKSPACE";
|
|
97
96
|
LABEL: "LABEL";
|
|
98
97
|
ASSIGNEE: "ASSIGNEE";
|
|
99
98
|
ADDED_DATE: "ADDED_DATE";
|
|
100
99
|
DUE_DATE: "DUE_DATE";
|
|
101
100
|
DEADLINE: "DEADLINE";
|
|
102
101
|
PRIORITY: "PRIORITY";
|
|
102
|
+
WORKSPACE: "WORKSPACE";
|
|
103
103
|
}>>>;
|
|
104
104
|
filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
105
|
viewMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -110,12 +110,12 @@ export declare const ViewOptionsSchema: z.ZodObject<{
|
|
|
110
110
|
showCompletedTasks: z.ZodOptional<z.ZodBoolean>;
|
|
111
111
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
112
112
|
PROJECT: "PROJECT";
|
|
113
|
-
WORKSPACE: "WORKSPACE";
|
|
114
113
|
ASSIGNEE: "ASSIGNEE";
|
|
115
114
|
ADDED_DATE: "ADDED_DATE";
|
|
116
115
|
DUE_DATE: "DUE_DATE";
|
|
117
116
|
DEADLINE: "DEADLINE";
|
|
118
117
|
PRIORITY: "PRIORITY";
|
|
118
|
+
WORKSPACE: "WORKSPACE";
|
|
119
119
|
MANUAL: "MANUAL";
|
|
120
120
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
121
121
|
}>>>;
|
|
@@ -134,22 +134,22 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
|
|
|
134
134
|
}>>>;
|
|
135
135
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
136
136
|
PROJECT: "PROJECT";
|
|
137
|
-
WORKSPACE: "WORKSPACE";
|
|
138
137
|
LABEL: "LABEL";
|
|
139
138
|
ASSIGNEE: "ASSIGNEE";
|
|
140
139
|
ADDED_DATE: "ADDED_DATE";
|
|
141
140
|
DUE_DATE: "DUE_DATE";
|
|
142
141
|
DEADLINE: "DEADLINE";
|
|
143
142
|
PRIORITY: "PRIORITY";
|
|
143
|
+
WORKSPACE: "WORKSPACE";
|
|
144
144
|
}>>>;
|
|
145
145
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
146
146
|
PROJECT: "PROJECT";
|
|
147
|
-
WORKSPACE: "WORKSPACE";
|
|
148
147
|
ASSIGNEE: "ASSIGNEE";
|
|
149
148
|
ADDED_DATE: "ADDED_DATE";
|
|
150
149
|
DUE_DATE: "DUE_DATE";
|
|
151
150
|
DEADLINE: "DEADLINE";
|
|
152
151
|
PRIORITY: "PRIORITY";
|
|
152
|
+
WORKSPACE: "WORKSPACE";
|
|
153
153
|
MANUAL: "MANUAL";
|
|
154
154
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
155
155
|
}>>>;
|
|
@@ -3,7 +3,7 @@ import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
|
|
|
3
3
|
import type { Section } from '../sections/types.js';
|
|
4
4
|
import type { Task } from '../tasks/types.js';
|
|
5
5
|
import type { WorkspaceUser } from '../workspaces/types.js';
|
|
6
|
-
import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal,
|
|
6
|
+
import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
|
|
7
7
|
export type SyncError = {
|
|
8
8
|
error: string;
|
|
9
9
|
errorCode: number;
|
|
@@ -43,7 +43,6 @@ export type SyncResponse = {
|
|
|
43
43
|
roleActions?: Record<string, unknown>[];
|
|
44
44
|
folders?: Folder[];
|
|
45
45
|
workspaceGoals?: WorkspaceGoal[];
|
|
46
|
-
goals?: Goal[];
|
|
47
46
|
dayOrders?: Record<string, number>;
|
|
48
47
|
calendars?: Calendar[];
|
|
49
48
|
calendarAccounts?: CalendarAccount[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PersonalProject, WorkspaceProject } from '../types/projects/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Type guard to check if a project is a workspace project.
|
|
4
|
+
* @param project The project to check
|
|
5
|
+
* @returns True if the project is a workspace project
|
|
6
|
+
*/
|
|
7
|
+
export declare function isWorkspaceProject(project: PersonalProject | WorkspaceProject): project is WorkspaceProject;
|
|
8
|
+
/**
|
|
9
|
+
* Type guard to check if a project is a personal project.
|
|
10
|
+
* @param project The project to check
|
|
11
|
+
* @returns True if the project is a personal project
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPersonalProject(project: PersonalProject | WorkspaceProject): project is PersonalProject;
|
|
@@ -81,18 +81,6 @@ export declare const validateTaskArray: (input: unknown) => {
|
|
|
81
81
|
dayOrder: number;
|
|
82
82
|
isCollapsed: boolean;
|
|
83
83
|
}[];
|
|
84
|
-
/**
|
|
85
|
-
* Type guard to check if a project is a workspace project.
|
|
86
|
-
* @param project The project to check
|
|
87
|
-
* @returns True if the project is a workspace project
|
|
88
|
-
*/
|
|
89
|
-
export declare function isWorkspaceProject(project: PersonalProject | WorkspaceProject): project is WorkspaceProject;
|
|
90
|
-
/**
|
|
91
|
-
* Type guard to check if a project is a personal project.
|
|
92
|
-
* @param project The project to check
|
|
93
|
-
* @returns True if the project is a personal project
|
|
94
|
-
*/
|
|
95
|
-
export declare function isPersonalProject(project: PersonalProject | WorkspaceProject): project is PersonalProject;
|
|
96
84
|
/**
|
|
97
85
|
* Validates and parses a project input.
|
|
98
86
|
* @param input The input to validate
|
|
@@ -834,54 +822,6 @@ export declare const validateWorkspaceFilterArray: (input: unknown) => {
|
|
|
834
822
|
createdAt: string;
|
|
835
823
|
updatedAt: string;
|
|
836
824
|
}[];
|
|
837
|
-
export declare const validateGoal: (input: unknown) => {
|
|
838
|
-
[x: string]: unknown;
|
|
839
|
-
id: string;
|
|
840
|
-
ownerType: "USER" | "WORKSPACE";
|
|
841
|
-
ownerId: string;
|
|
842
|
-
name: string;
|
|
843
|
-
description: string | null;
|
|
844
|
-
deadline: string | null;
|
|
845
|
-
parentGoalId: string | null;
|
|
846
|
-
childOrder: number;
|
|
847
|
-
isCompleted: boolean;
|
|
848
|
-
completedAt: Date | null;
|
|
849
|
-
responsibleUid: string | null;
|
|
850
|
-
isDeleted: boolean;
|
|
851
|
-
creatorUid: string;
|
|
852
|
-
createdAt: Date;
|
|
853
|
-
updatedAt: Date;
|
|
854
|
-
progress?: {
|
|
855
|
-
[x: string]: unknown;
|
|
856
|
-
totalItemCount: number;
|
|
857
|
-
completedItemCount: number;
|
|
858
|
-
percentage: number;
|
|
859
|
-
} | undefined;
|
|
860
|
-
};
|
|
861
|
-
export declare const validateGoalArray: (input: unknown) => {
|
|
862
|
-
[x: string]: unknown;
|
|
863
|
-
id: string;
|
|
864
|
-
ownerType: "USER" | "WORKSPACE";
|
|
865
|
-
ownerId: string;
|
|
866
|
-
name: string;
|
|
867
|
-
description: string | null;
|
|
868
|
-
deadline: string | null;
|
|
869
|
-
parentGoalId: string | null;
|
|
870
|
-
childOrder: number;
|
|
871
|
-
isCompleted: boolean;
|
|
872
|
-
completedAt: Date | null;
|
|
873
|
-
responsibleUid: string | null;
|
|
874
|
-
isDeleted: boolean;
|
|
875
|
-
creatorUid: string;
|
|
876
|
-
createdAt: Date;
|
|
877
|
-
updatedAt: Date;
|
|
878
|
-
progress?: {
|
|
879
|
-
[x: string]: unknown;
|
|
880
|
-
totalItemCount: number;
|
|
881
|
-
completedItemCount: number;
|
|
882
|
-
percentage: number;
|
|
883
|
-
} | undefined;
|
|
884
|
-
}[];
|
|
885
825
|
export declare const validateWorkspaceGoal: (input: unknown) => {
|
|
886
826
|
[x: string]: unknown;
|
|
887
827
|
id: string;
|
|
@@ -1122,30 +1062,30 @@ export declare const validateViewOptions: (input: unknown) => {
|
|
|
1122
1062
|
[x: string]: unknown;
|
|
1123
1063
|
viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
|
|
1124
1064
|
objectId?: string | undefined;
|
|
1125
|
-
groupedBy?: "PROJECT" | "
|
|
1065
|
+
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
|
|
1126
1066
|
filteredBy?: string | null | undefined;
|
|
1127
1067
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
|
|
1128
1068
|
showCompletedTasks?: boolean | undefined;
|
|
1129
|
-
sortedBy?: "PROJECT" | "
|
|
1069
|
+
sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1130
1070
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1131
1071
|
};
|
|
1132
1072
|
export declare const validateViewOptionsArray: (input: unknown) => {
|
|
1133
1073
|
[x: string]: unknown;
|
|
1134
1074
|
viewType: "PROJECT" | "TODAY" | "UPCOMING" | "LABEL" | "FILTER" | "WORKSPACE_FILTER" | "SEARCH" | "TEMPLATE_PREVIEW" | "TASK_DETAIL" | "AUTOMATION" | "ASSIGNED" | "OVERDUE" | "WORKSPACE_OVERVIEW";
|
|
1135
1075
|
objectId?: string | undefined;
|
|
1136
|
-
groupedBy?: "PROJECT" | "
|
|
1076
|
+
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
|
|
1137
1077
|
filteredBy?: string | null | undefined;
|
|
1138
1078
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | undefined;
|
|
1139
1079
|
showCompletedTasks?: boolean | undefined;
|
|
1140
|
-
sortedBy?: "PROJECT" | "
|
|
1080
|
+
sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1141
1081
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1142
1082
|
}[];
|
|
1143
1083
|
export declare const validateProjectViewOptionsDefaults: (input: unknown) => {
|
|
1144
1084
|
[x: string]: unknown;
|
|
1145
1085
|
projectId: string;
|
|
1146
1086
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
|
|
1147
|
-
groupedBy?: "PROJECT" | "
|
|
1148
|
-
sortedBy?: "PROJECT" | "
|
|
1087
|
+
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
|
|
1088
|
+
sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1149
1089
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1150
1090
|
showCompletedTasks?: boolean | undefined;
|
|
1151
1091
|
filteredBy?: string | null | undefined;
|
|
@@ -1158,8 +1098,8 @@ export declare const validateProjectViewOptionsDefaultsArray: (input: unknown) =
|
|
|
1158
1098
|
[x: string]: unknown;
|
|
1159
1099
|
projectId: string;
|
|
1160
1100
|
viewMode?: "LIST" | "BOARD" | "CALENDAR" | null | undefined;
|
|
1161
|
-
groupedBy?: "PROJECT" | "
|
|
1162
|
-
sortedBy?: "PROJECT" | "
|
|
1101
|
+
groupedBy?: "PROJECT" | "LABEL" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | null | undefined;
|
|
1102
|
+
sortedBy?: "PROJECT" | "ASSIGNEE" | "ADDED_DATE" | "DUE_DATE" | "DEADLINE" | "PRIORITY" | "WORKSPACE" | "MANUAL" | "ALPHABETICALLY" | null | undefined;
|
|
1163
1103
|
sortOrder?: "ASC" | "DESC" | null | undefined;
|
|
1164
1104
|
showCompletedTasks?: boolean | undefined;
|
|
1165
1105
|
filteredBy?: string | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GoalSchema = exports.GoalProgressSchema = exports.GOAL_OWNER_TYPES = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/** Available goal owner types. */
|
|
6
|
-
exports.GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
|
|
7
|
-
exports.GoalProgressSchema = zod_1.z
|
|
8
|
-
.object({
|
|
9
|
-
totalItemCount: zod_1.z.number().int(),
|
|
10
|
-
completedItemCount: zod_1.z.number().int(),
|
|
11
|
-
percentage: zod_1.z.number(),
|
|
12
|
-
})
|
|
13
|
-
.passthrough();
|
|
14
|
-
exports.GoalSchema = zod_1.z
|
|
15
|
-
.object({
|
|
16
|
-
id: zod_1.z.string(),
|
|
17
|
-
ownerType: zod_1.z.enum(exports.GOAL_OWNER_TYPES),
|
|
18
|
-
ownerId: zod_1.z.string(),
|
|
19
|
-
name: zod_1.z.string(),
|
|
20
|
-
description: zod_1.z.string().nullable(),
|
|
21
|
-
deadline: zod_1.z.string().nullable(),
|
|
22
|
-
parentGoalId: zod_1.z.string().nullable(),
|
|
23
|
-
childOrder: zod_1.z.number().int(),
|
|
24
|
-
isCompleted: zod_1.z.boolean(),
|
|
25
|
-
completedAt: zod_1.z.coerce.date().nullable(),
|
|
26
|
-
responsibleUid: zod_1.z.string().nullable(),
|
|
27
|
-
isDeleted: zod_1.z.boolean(),
|
|
28
|
-
progress: exports.GoalProgressSchema.optional(),
|
|
29
|
-
creatorUid: zod_1.z.string(),
|
|
30
|
-
createdAt: zod_1.z.coerce.date(),
|
|
31
|
-
updatedAt: zod_1.z.coerce.date(),
|
|
32
|
-
})
|
|
33
|
-
.passthrough();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** Available goal owner types. */
|
|
3
|
-
export const GOAL_OWNER_TYPES = ['USER', 'WORKSPACE'];
|
|
4
|
-
export const GoalProgressSchema = z
|
|
5
|
-
.object({
|
|
6
|
-
totalItemCount: z.number().int(),
|
|
7
|
-
completedItemCount: z.number().int(),
|
|
8
|
-
percentage: z.number(),
|
|
9
|
-
})
|
|
10
|
-
.passthrough();
|
|
11
|
-
export const GoalSchema = z
|
|
12
|
-
.object({
|
|
13
|
-
id: z.string(),
|
|
14
|
-
ownerType: z.enum(GOAL_OWNER_TYPES),
|
|
15
|
-
ownerId: z.string(),
|
|
16
|
-
name: z.string(),
|
|
17
|
-
description: z.string().nullable(),
|
|
18
|
-
deadline: z.string().nullable(),
|
|
19
|
-
parentGoalId: z.string().nullable(),
|
|
20
|
-
childOrder: z.number().int(),
|
|
21
|
-
isCompleted: z.boolean(),
|
|
22
|
-
completedAt: z.coerce.date().nullable(),
|
|
23
|
-
responsibleUid: z.string().nullable(),
|
|
24
|
-
isDeleted: z.boolean(),
|
|
25
|
-
progress: GoalProgressSchema.optional(),
|
|
26
|
-
creatorUid: z.string(),
|
|
27
|
-
createdAt: z.coerce.date(),
|
|
28
|
-
updatedAt: z.coerce.date(),
|
|
29
|
-
})
|
|
30
|
-
.passthrough();
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { GoalOwnerType } from '../resources/goals.js';
|
|
2
|
-
export type GoalAddArgs = {
|
|
3
|
-
ownerType: GoalOwnerType;
|
|
4
|
-
ownerId: string;
|
|
5
|
-
name: string;
|
|
6
|
-
description?: string | null;
|
|
7
|
-
deadline?: string | null;
|
|
8
|
-
responsibleUid?: string | null;
|
|
9
|
-
};
|
|
10
|
-
export type GoalUpdateArgs = {
|
|
11
|
-
id: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
description?: string | null;
|
|
14
|
-
deadline?: string | null;
|
|
15
|
-
responsibleUid?: string | null;
|
|
16
|
-
};
|
|
17
|
-
export type GoalCompleteArgs = {
|
|
18
|
-
id: string;
|
|
19
|
-
};
|
|
20
|
-
export type GoalUncompleteArgs = {
|
|
21
|
-
id: string;
|
|
22
|
-
};
|
|
23
|
-
export type GoalDeleteArgs = {
|
|
24
|
-
id: string;
|
|
25
|
-
};
|
|
26
|
-
export type GoalLinkItemArgs = {
|
|
27
|
-
goalId: string;
|
|
28
|
-
itemId: string;
|
|
29
|
-
};
|
|
30
|
-
export type GoalUnlinkItemArgs = {
|
|
31
|
-
goalId: string;
|
|
32
|
-
itemId: string;
|
|
33
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** Available goal owner types. */
|
|
3
|
-
export declare const GOAL_OWNER_TYPES: readonly ["USER", "WORKSPACE"];
|
|
4
|
-
/** Goal owner type. */
|
|
5
|
-
export type GoalOwnerType = (typeof GOAL_OWNER_TYPES)[number];
|
|
6
|
-
export declare const GoalProgressSchema: z.ZodObject<{
|
|
7
|
-
totalItemCount: z.ZodNumber;
|
|
8
|
-
completedItemCount: z.ZodNumber;
|
|
9
|
-
percentage: z.ZodNumber;
|
|
10
|
-
}, z.core.$loose>;
|
|
11
|
-
export type GoalProgress = z.infer<typeof GoalProgressSchema>;
|
|
12
|
-
export declare const GoalSchema: z.ZodObject<{
|
|
13
|
-
id: z.ZodString;
|
|
14
|
-
ownerType: z.ZodEnum<{
|
|
15
|
-
USER: "USER";
|
|
16
|
-
WORKSPACE: "WORKSPACE";
|
|
17
|
-
}>;
|
|
18
|
-
ownerId: z.ZodString;
|
|
19
|
-
name: z.ZodString;
|
|
20
|
-
description: z.ZodNullable<z.ZodString>;
|
|
21
|
-
deadline: z.ZodNullable<z.ZodString>;
|
|
22
|
-
parentGoalId: z.ZodNullable<z.ZodString>;
|
|
23
|
-
childOrder: z.ZodNumber;
|
|
24
|
-
isCompleted: z.ZodBoolean;
|
|
25
|
-
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
26
|
-
responsibleUid: z.ZodNullable<z.ZodString>;
|
|
27
|
-
isDeleted: z.ZodBoolean;
|
|
28
|
-
progress: z.ZodOptional<z.ZodObject<{
|
|
29
|
-
totalItemCount: z.ZodNumber;
|
|
30
|
-
completedItemCount: z.ZodNumber;
|
|
31
|
-
percentage: z.ZodNumber;
|
|
32
|
-
}, z.core.$loose>>;
|
|
33
|
-
creatorUid: z.ZodString;
|
|
34
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
35
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
36
|
-
}, z.core.$loose>;
|
|
37
|
-
export type Goal = z.infer<typeof GoalSchema>;
|