@doist/todoist-sdk 8.0.1 → 8.2.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/README.md +23 -24
- package/dist/cjs/authentication.js +76 -9
- package/dist/cjs/consts/endpoints.js +2 -1
- package/dist/cjs/test-utils/msw-setup.js +2 -2
- package/dist/cjs/todoist-api.js +14 -9
- package/dist/cjs/types/reminders/requests.js +1 -1
- package/dist/cjs/types/sync/commands/goals.js +2 -0
- package/dist/cjs/types/sync/commands/index.js +1 -0
- package/dist/cjs/types/sync/resource-types.js +1 -0
- package/dist/cjs/types/sync/resources/goals.js +33 -0
- package/dist/cjs/types/sync/resources/index.js +1 -0
- package/dist/cjs/types/tasks/types.js +1 -1
- package/dist/cjs/utils/validators.js +36 -36
- package/dist/esm/authentication.js +74 -8
- package/dist/esm/consts/endpoints.js +1 -0
- package/dist/esm/test-utils/msw-setup.js +2 -2
- package/dist/esm/todoist-api.js +14 -9
- package/dist/esm/types/reminders/requests.js +1 -1
- package/dist/esm/types/sync/commands/goals.js +1 -0
- package/dist/esm/types/sync/commands/index.js +1 -0
- package/dist/esm/types/sync/resource-types.js +1 -0
- package/dist/esm/types/sync/resources/goals.js +30 -0
- package/dist/esm/types/sync/resources/index.js +1 -0
- package/dist/esm/types/tasks/types.js +1 -1
- package/dist/esm/utils/validators.js +8 -8
- package/dist/types/authentication.d.ts +73 -5
- package/dist/types/consts/endpoints.d.ts +1 -0
- package/dist/types/todoist-api.d.ts +16 -16
- package/dist/types/types/projects/requests.d.ts +1 -1
- package/dist/types/types/sync/commands/goals.d.ts +33 -0
- package/dist/types/types/sync/commands/index.d.ts +21 -12
- package/dist/types/types/sync/commands/projects.d.ts +1 -1
- package/dist/types/types/sync/commands/reminders.d.ts +1 -1
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/goals.d.ts +37 -0
- package/dist/types/types/sync/resources/index.d.ts +1 -0
- package/dist/types/types/sync/resources/view-options.d.ts +9 -9
- package/dist/types/types/sync/response.d.ts +4 -3
- package/dist/types/utils/validators.d.ts +8 -8
- package/package.json +6 -11
package/dist/esm/todoist-api.js
CHANGED
|
@@ -9,20 +9,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_TASKS_COMPLETED, ENDPOINT_REST_TEMPLATES_FILE, ENDPOINT_REST_TEMPLATES_URL, ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LOCATION_REMINDERS, ENDPOINT_REST_REMINDERS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE, ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT, ENDPOINT_REST_PROJECTS_PERMISSIONS, ENDPOINT_REST_PROJECT_FULL, ENDPOINT_REST_PROJECT_JOIN, SECTION_ARCHIVE, SECTION_UNARCHIVE, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, getProjectInsightsActivityStatsEndpoint, getProjectInsightsHealthEndpoint, getProjectInsightsHealthContextEndpoint, getProjectInsightsProgressEndpoint, getProjectInsightsHealthAnalyzeEndpoint, getWorkspaceInsightsEndpoint, ENDPOINT_REST_BACKUPS, ENDPOINT_REST_BACKUPS_DOWNLOAD, ENDPOINT_REST_EMAILS, ENDPOINT_REST_ID_MAPPINGS, ENDPOINT_REST_MOVED_IDS, ENDPOINT_REST_WORKSPACES, ENDPOINT_WORKSPACE_MEMBERS, getWorkspaceUserTasksEndpoint, getWorkspaceInviteUsersEndpoint, getWorkspaceUserEndpoint, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, ENDPOINT_REST_FOLDERS, } from './consts/endpoints.js';
|
|
14
|
+
import { request, isSuccess } from './transport/http-client.js';
|
|
12
15
|
import { WorkspaceProjectSchema, } from './types/projects/index.js';
|
|
13
16
|
import { UpdateReminderArgsSchema, UpdateLocationReminderArgsSchema, ReminderIdSchema, } from './types/reminders/index.js';
|
|
14
|
-
import {
|
|
15
|
-
import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_TASKS_COMPLETED, ENDPOINT_REST_TEMPLATES_FILE, ENDPOINT_REST_TEMPLATES_URL, ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE, ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LOCATION_REMINDERS, ENDPOINT_REST_REMINDERS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE, ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT, ENDPOINT_REST_PROJECTS_PERMISSIONS, ENDPOINT_REST_PROJECT_FULL, ENDPOINT_REST_PROJECT_JOIN, SECTION_ARCHIVE, SECTION_UNARCHIVE, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, getProjectInsightsActivityStatsEndpoint, getProjectInsightsHealthEndpoint, getProjectInsightsHealthContextEndpoint, getProjectInsightsProgressEndpoint, getProjectInsightsHealthAnalyzeEndpoint, getWorkspaceInsightsEndpoint, ENDPOINT_REST_BACKUPS, ENDPOINT_REST_BACKUPS_DOWNLOAD, ENDPOINT_REST_EMAILS, ENDPOINT_REST_ID_MAPPINGS, ENDPOINT_REST_MOVED_IDS, ENDPOINT_REST_WORKSPACES, ENDPOINT_WORKSPACE_MEMBERS, getWorkspaceUserTasksEndpoint, getWorkspaceInviteUsersEndpoint, getWorkspaceUserEndpoint, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, ENDPOINT_REST_FOLDERS, } from './consts/endpoints.js';
|
|
16
|
-
import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateReminder, validateReminderArray, validateLocationReminderArray, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, validateWorkspace, validateWorkspaceArray, validateMemberActivityInfoArray, validateWorkspaceUserTaskArray, validateProjectActivityStats, validateProjectHealth, validateProjectHealthContext, validateProjectProgress, validateWorkspaceInsights, validateBackupArray, validateIdMappingArray, validateMovedIdArray, validateFolder, validateFolderArray, validateCollaboratorArray, validateCollaboratorStateArray, validateNoteArray, } from './utils/validators.js';
|
|
17
|
-
import { formatDateToYYYYMMDD } from './utils/url-helpers.js';
|
|
18
|
-
import { uploadMultipartFile } from './utils/multipart-upload.js';
|
|
19
|
-
import { camelCaseKeys } from './utils/case-conversion.js';
|
|
17
|
+
import { GoalSchema } from './types/sync/resources/goals.js';
|
|
20
18
|
import { normalizeObjectEventTypeForApi, denormalizeObjectTypeFromApi, } from './utils/activity-helpers.js';
|
|
19
|
+
import { camelCaseKeys } from './utils/case-conversion.js';
|
|
20
|
+
import { uploadMultipartFile } from './utils/multipart-upload.js';
|
|
21
21
|
import { processTaskContent } from './utils/uncompletable-helpers.js';
|
|
22
|
-
import {
|
|
22
|
+
import { formatDateToYYYYMMDD } from './utils/url-helpers.js';
|
|
23
|
+
import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateReminder, validateReminderArray, validateLocationReminderArray, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, validateWorkspace, validateWorkspaceArray, validateMemberActivityInfoArray, validateWorkspaceUserTaskArray, validateProjectActivityStats, validateProjectHealth, validateProjectHealthContext, validateProjectProgress, validateWorkspaceInsights, validateBackupArray, validateIdMappingArray, validateMovedIdArray, validateFolder, validateFolderArray, validateCollaboratorArray, validateCollaboratorStateArray, validateNoteArray, } from './utils/validators.js';
|
|
23
24
|
import { v4 as uuidv4 } from 'uuid';
|
|
24
|
-
import { DATE_FORMAT_TO_API, TIME_FORMAT_TO_API, DAY_OF_WEEK_TO_API, } from './types/sync/index.js';
|
|
25
25
|
import { TodoistArgumentError, TodoistRequestError } from './types/index.js';
|
|
26
|
+
import { DATE_FORMAT_TO_API, TIME_FORMAT_TO_API, DAY_OF_WEEK_TO_API, } from './types/sync/index.js';
|
|
26
27
|
const MAX_COMMAND_COUNT = 100;
|
|
27
28
|
/**
|
|
28
29
|
* Joins path segments using `/` separator.
|
|
@@ -132,7 +133,11 @@ export class TodoistApi {
|
|
|
132
133
|
throw new TodoistRequestError(value.error, value.httpCode, value.errorExtra);
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
+
const data = response.data;
|
|
137
|
+
if (data.goals) {
|
|
138
|
+
data.goals = data.goals.map((goal) => GoalSchema.parse(goal));
|
|
139
|
+
}
|
|
140
|
+
return data;
|
|
136
141
|
}
|
|
137
142
|
/**
|
|
138
143
|
* Executes a raw Sync API request.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DueDateSchema } from '../tasks/types.js';
|
|
3
2
|
import { LOCATION_TRIGGERS, ReminderTypeEnum } from '../sync/resources/reminders.js';
|
|
3
|
+
import { DueDateSchema } from '../tasks/types.js';
|
|
4
4
|
/** Available reminder delivery services. */
|
|
5
5
|
export const REMINDER_DELIVERY_SERVICES = ['email', 'push'];
|
|
6
6
|
export const ReminderDeliveryServiceSchema = z.enum(REMINDER_DELIVERY_SERVICES);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,7 @@ 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';
|
|
14
15
|
export * from './notifications.js';
|
|
15
16
|
export * from './sharing.js';
|
|
16
17
|
export * from './view-options.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
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();
|
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
export * from './calendars.js';
|
|
9
10
|
export * from './reminders.js';
|
|
10
11
|
export * from './completed-info.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { getTaskUrl } from '../../utils/url-helpers.js';
|
|
3
2
|
import { hasUncompletablePrefix } from '../../utils/uncompletable-helpers.js';
|
|
3
|
+
import { getTaskUrl } from '../../utils/url-helpers.js';
|
|
4
4
|
export const DueDateSchema = z
|
|
5
5
|
.object({
|
|
6
6
|
isRecurring: z.boolean(),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActivityEventSchema } from '../types/activity/types.js';
|
|
2
|
+
import { BackupSchema } from '../types/backups/types.js';
|
|
3
|
+
import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
|
|
4
|
+
import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
|
|
5
|
+
import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
|
|
6
|
+
import { LabelSchema } from '../types/labels/types.js';
|
|
7
|
+
import { ProductivityStatsSchema } from '../types/productivity/types.js';
|
|
2
8
|
import { PersonalProjectSchema, WorkspaceProjectSchema, } from '../types/projects/types.js';
|
|
3
9
|
import { SectionSchema } from '../types/sections/types.js';
|
|
4
|
-
import {
|
|
5
|
-
import { AttachmentSchema, CommentSchema } from '../types/comments/types.js';
|
|
10
|
+
import { TaskSchema } from '../types/tasks/types.js';
|
|
6
11
|
import { UserSchema, CurrentUserSchema } from '../types/users/types.js';
|
|
7
|
-
import { ProductivityStatsSchema } from '../types/productivity/types.js';
|
|
8
|
-
import { ActivityEventSchema } from '../types/activity/types.js';
|
|
9
12
|
import { WorkspaceUserSchema, WorkspaceInvitationSchema, WorkspacePlanDetailsSchema, JoinWorkspaceResultSchema, WorkspaceSchema, MemberActivityInfoSchema, WorkspaceUserTaskSchema, } from '../types/workspaces/types.js';
|
|
10
|
-
import { ProjectActivityStatsSchema, ProjectHealthSchema, ProjectHealthContextSchema, ProjectProgressSchema, WorkspaceInsightsSchema, } from '../types/insights/types.js';
|
|
11
|
-
import { BackupSchema } from '../types/backups/types.js';
|
|
12
|
-
import { IdMappingSchema, MovedIdSchema } from '../types/id-mappings/types.js';
|
|
13
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);
|
|
@@ -13,6 +13,51 @@ export declare const PERMISSIONS: readonly ["task:add", "data:read", "data:read_
|
|
|
13
13
|
* @see {@link https://developer.todoist.com/api/v1/#tag/Authorization}
|
|
14
14
|
*/
|
|
15
15
|
export type Permission = (typeof PERMISSIONS)[number];
|
|
16
|
+
/** Supported token endpoint authentication methods for dynamic client registration. */
|
|
17
|
+
export declare const TOKEN_ENDPOINT_AUTH_METHODS: readonly ["client_secret_post", "client_secret_basic", "none"];
|
|
18
|
+
/**
|
|
19
|
+
* Authentication method used at the token endpoint.
|
|
20
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc7591#section-2 RFC 7591 Section 2}
|
|
21
|
+
*/
|
|
22
|
+
export type TokenEndpointAuthMethod = (typeof TOKEN_ENDPOINT_AUTH_METHODS)[number];
|
|
23
|
+
/**
|
|
24
|
+
* Parameters for registering a new OAuth client via Dynamic Client Registration.
|
|
25
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc7591 RFC 7591}
|
|
26
|
+
*/
|
|
27
|
+
export type ClientRegistrationRequest = {
|
|
28
|
+
redirectUris: string[];
|
|
29
|
+
clientName?: string;
|
|
30
|
+
clientUri?: string;
|
|
31
|
+
logoUri?: string;
|
|
32
|
+
scope?: readonly Permission[];
|
|
33
|
+
grantTypes?: string[];
|
|
34
|
+
responseTypes?: string[];
|
|
35
|
+
tokenEndpointAuthMethod?: TokenEndpointAuthMethod;
|
|
36
|
+
};
|
|
37
|
+
type RawClientRegistrationResponse = {
|
|
38
|
+
clientId: string;
|
|
39
|
+
clientSecret?: string;
|
|
40
|
+
clientName: string;
|
|
41
|
+
redirectUris: string[];
|
|
42
|
+
scope?: string;
|
|
43
|
+
grantTypes: string[];
|
|
44
|
+
responseTypes: string[];
|
|
45
|
+
tokenEndpointAuthMethod: string;
|
|
46
|
+
clientIdIssuedAt?: number;
|
|
47
|
+
clientSecretExpiresAt?: number;
|
|
48
|
+
clientUri?: string;
|
|
49
|
+
logoUri?: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Response from a successful dynamic client registration.
|
|
53
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc7591#section-3.2.1 RFC 7591 Section 3.2.1}
|
|
54
|
+
*/
|
|
55
|
+
export type ClientRegistrationResponse = Omit<RawClientRegistrationResponse, 'clientIdIssuedAt' | 'clientSecretExpiresAt' | 'scope'> & {
|
|
56
|
+
scope?: Permission[];
|
|
57
|
+
clientIdIssuedAt?: Date;
|
|
58
|
+
/** `null` indicates the client secret never expires. Absent when no secret is issued. */
|
|
59
|
+
clientSecretExpiresAt?: Date | null;
|
|
60
|
+
};
|
|
16
61
|
/**
|
|
17
62
|
* Parameters required to exchange an authorization code for an access token.
|
|
18
63
|
* @see https://developer.todoist.com/api/v1/#tag/Authorization/OAuth
|
|
@@ -80,13 +125,17 @@ export declare function getAuthStateParameter(): string;
|
|
|
80
125
|
/**
|
|
81
126
|
* Generates the authorization URL for the OAuth2 flow.
|
|
82
127
|
*
|
|
128
|
+
* The `clientId` can be either a traditional client ID string (e.g. from
|
|
129
|
+
* {@link registerClient}) or an HTTPS URL pointing to a client metadata document,
|
|
130
|
+
* as defined in {@link https://drafts.ietf.org/doc/draft-ietf-oauth-client-id-metadata-document/ RFC draft-ietf-oauth-client-id-metadata-document}.
|
|
131
|
+
*
|
|
83
132
|
* @example
|
|
84
133
|
* ```typescript
|
|
85
|
-
* const url = getAuthorizationUrl(
|
|
86
|
-
* 'your-client-id',
|
|
87
|
-
* ['data:read', 'task:add'],
|
|
88
|
-
* state
|
|
89
|
-
* )
|
|
134
|
+
* const url = getAuthorizationUrl({
|
|
135
|
+
* clientId: 'your-client-id',
|
|
136
|
+
* permissions: ['data:read', 'task:add'],
|
|
137
|
+
* state,
|
|
138
|
+
* })
|
|
90
139
|
* // Redirect user to url
|
|
91
140
|
* ```
|
|
92
141
|
*
|
|
@@ -156,3 +205,22 @@ export declare function revokeToken(args: RevokeTokenRequestArgs, options?: Auth
|
|
|
156
205
|
* @throws {@link TodoistRequestError} If the migration fails
|
|
157
206
|
*/
|
|
158
207
|
export declare function migratePersonalToken(args: MigratePersonalTokenArgs, options?: AuthOptions): Promise<MigratePersonalTokenResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Registers a new OAuth client via Dynamic Client Registration (RFC 7591).
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* const client = await registerClient({
|
|
214
|
+
* redirectUris: ['https://example.com/callback'],
|
|
215
|
+
* clientName: 'My App',
|
|
216
|
+
* scope: ['data:read_write', 'task:add'],
|
|
217
|
+
* })
|
|
218
|
+
* // Use client.clientId and client.clientSecret for OAuth flows
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* @returns The registered client details
|
|
222
|
+
* @throws {@link TodoistRequestError} If the registration fails
|
|
223
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc7591 RFC 7591}
|
|
224
|
+
*/
|
|
225
|
+
export declare function registerClient(args: ClientRegistrationRequest, options?: AuthOptions): Promise<ClientRegistrationResponse>;
|
|
226
|
+
export {};
|
|
@@ -56,6 +56,7 @@ export declare const ENDPOINT_SYNC = "sync";
|
|
|
56
56
|
export declare const ENDPOINT_AUTHORIZATION = "authorize";
|
|
57
57
|
export declare const ENDPOINT_GET_TOKEN = "access_token";
|
|
58
58
|
export declare const ENDPOINT_REVOKE = "revoke";
|
|
59
|
+
export declare const ENDPOINT_REGISTER = "register";
|
|
59
60
|
export declare const ENDPOINT_REST_FOLDERS = "folders";
|
|
60
61
|
export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
|
|
61
62
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PersonalProject, WorkspaceProject, AddProjectArgs, UpdateProjectArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetProjectsResponse, GetProjectCollaboratorsResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetProjectPermissionsResponse, GetFullProjectArgs, GetFullProjectResponse, JoinProjectResponse } from './types/projects/index.js';
|
|
3
|
-
import { Section, AddSectionArgs, UpdateSectionArgs, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse } from './types/sections/index.js';
|
|
4
|
-
import { Label, AddLabelArgs, UpdateLabelArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/labels/index.js';
|
|
5
|
-
import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
|
|
6
|
-
import { AddReminderArgs, UpdateReminderArgs, AddLocationReminderArgs, UpdateLocationReminderArgs, GetRemindersArgs, GetRemindersResponse, GetLocationRemindersArgs, GetLocationRemindersResponse } from './types/reminders/index.js';
|
|
7
|
-
import { CurrentUser } from './types/users/index.js';
|
|
8
|
-
import { ProductivityStats } from './types/productivity/index.js';
|
|
1
|
+
import type { Reminder } from './types/index.js';
|
|
9
2
|
import { GetActivityLogsArgs, GetActivityLogsResponse } from './types/activity/index.js';
|
|
10
|
-
import { WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/workspaces/index.js';
|
|
11
|
-
import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
|
|
12
|
-
import type { Folder } from './types/sync/resources/folders.js';
|
|
13
|
-
import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
|
|
14
3
|
import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/index.js';
|
|
15
|
-
import {
|
|
4
|
+
import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
|
|
16
5
|
import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
|
|
17
|
-
import {
|
|
18
|
-
import { ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse } from './types/templates/index.js';
|
|
6
|
+
import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
|
|
19
7
|
import { CustomFetch, CustomFetchResponse } from './types/http.js';
|
|
20
|
-
import
|
|
8
|
+
import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
|
|
9
|
+
import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
|
|
10
|
+
import { Label, AddLabelArgs, UpdateLabelArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/labels/index.js';
|
|
11
|
+
import { ProductivityStats } from './types/productivity/index.js';
|
|
12
|
+
import { PersonalProject, WorkspaceProject, AddProjectArgs, UpdateProjectArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetProjectsResponse, GetProjectCollaboratorsResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetProjectPermissionsResponse, GetFullProjectArgs, GetFullProjectResponse, JoinProjectResponse } from './types/projects/index.js';
|
|
13
|
+
import { AddReminderArgs, UpdateReminderArgs, AddLocationReminderArgs, UpdateLocationReminderArgs, GetRemindersArgs, GetRemindersResponse, GetLocationRemindersArgs, GetLocationRemindersResponse } from './types/reminders/index.js';
|
|
14
|
+
import { Section, AddSectionArgs, UpdateSectionArgs, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse } from './types/sections/index.js';
|
|
15
|
+
import type { Folder } from './types/sync/resources/folders.js';
|
|
16
|
+
import { Task, AddTaskArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateTaskArgs, QuickAddTaskArgs, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, SearchCompletedTasksArgs, GetTasksResponse, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse } from './types/tasks/index.js';
|
|
17
|
+
import { ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse } from './types/templates/index.js';
|
|
18
|
+
import { UploadFileArgs, DeleteUploadArgs } from './types/uploads/index.js';
|
|
19
|
+
import { CurrentUser } from './types/users/index.js';
|
|
20
|
+
import { WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/workspaces/index.js';
|
|
21
21
|
import { type SyncResponse, type SyncRequest } from './types/sync/index.js';
|
|
22
22
|
/**
|
|
23
23
|
* Response from viewAttachment, extending CustomFetchResponse with
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColorKey } from '../../utils/colors.js';
|
|
2
|
-
import type { SearchArgs } from '../common.js';
|
|
3
2
|
import type { Comment } from '../comments/types.js';
|
|
3
|
+
import type { SearchArgs } from '../common.js';
|
|
4
4
|
import type { Section } from '../sections/types.js';
|
|
5
5
|
import type { Collaborator, CollaboratorState } from '../sync/resources/collaborators.js';
|
|
6
6
|
import type { Folder } from '../sync/resources/folders.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
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,20 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ProjectAddArgs, ProjectUpdateArgs, ProjectMoveArgs, ProjectReorderArgs, ShareProjectArgs, ProjectLeaveArgs, ProjectArchiveArgs, ProjectUnarchiveArgs, ProjectDeleteArgs, ProjectMoveToWorkspaceArgs, ProjectMoveToPersonalArgs } from './projects.js';
|
|
3
|
-
import type { SectionAddArgs, SectionUpdateArgs, SectionMoveArgs, SectionReorderArgs, SectionArchiveArgs, SectionUnarchiveArgs, SectionDeleteArgs } from './sections.js';
|
|
4
|
-
import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
|
|
1
|
+
import type { CalendarUpdateArgs, CalendarAccountUpdateArgs, CalendarAccountRestoreTaskCalendarArgs } from './calendars.js';
|
|
5
2
|
import type { FilterAddArgs, FilterUpdateArgs, FilterUpdateOrdersArgs, FilterDeleteArgs } from './filters.js';
|
|
6
|
-
import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
|
|
7
|
-
import type { ReminderAddArgs, ReminderUpdateArgs, ReminderDeleteArgs } from './reminders.js';
|
|
8
|
-
import type { WorkspaceAddArgs, WorkspaceUpdateArgs, WorkspaceDeleteArgs, WorkspaceUpdateUserArgs, WorkspaceDeleteUserArgs, WorkspaceLeaveArgs, WorkspaceInviteArgs, WorkspaceSetDefaultOrderArgs, WorkspaceUpdateUserProjectSortPreferenceArgs } from './workspaces.js';
|
|
9
3
|
import type { FolderAddArgs, FolderUpdateArgs, FolderDeleteArgs } from './folders.js';
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
4
|
+
import type { GoalAddArgs, GoalUpdateArgs, GoalCompleteArgs, GoalUncompleteArgs, GoalDeleteArgs, GoalLinkItemArgs, GoalUnlinkItemArgs } from './goals.js';
|
|
5
|
+
import type { LabelAddArgs, LabelRenameArgs, LabelUpdateArgs, LabelUpdateOrdersArgs, LabelDeleteArgs, LabelDeleteOccurrencesArgs } from './labels.js';
|
|
6
|
+
import type { NoteAddArgs, NoteUpdateArgs, NoteDeleteArgs, NoteReactionAddArgs, NoteReactionRemoveArgs } from './notes.js';
|
|
12
7
|
import type { LiveNotificationsMarkUnreadArgs, LiveNotificationsMarkReadArgs, LiveNotificationsMarkReadAllArgs, LiveNotificationsSetLastReadArgs } from './notifications.js';
|
|
8
|
+
import type { UserUpdateArgs, DeleteCollaboratorArgs, IdMappingArgs, SuggestionDeleteArgs, UserSettingsUpdateArgs, UpdateGoalsArgs } from './others.js';
|
|
9
|
+
import type { ProjectViewOptionsDefaultsSetArgs } from './project-view-options.js';
|
|
10
|
+
import type { ProjectAddArgs, ProjectUpdateArgs, ProjectMoveArgs, ProjectReorderArgs, ShareProjectArgs, ProjectLeaveArgs, ProjectArchiveArgs, ProjectUnarchiveArgs, ProjectDeleteArgs, ProjectMoveToWorkspaceArgs, ProjectMoveToPersonalArgs } from './projects.js';
|
|
11
|
+
import type { ReminderAddArgs, ReminderUpdateArgs, ReminderDeleteArgs } from './reminders.js';
|
|
12
|
+
import type { SectionAddArgs, SectionUpdateArgs, SectionMoveArgs, SectionReorderArgs, SectionArchiveArgs, SectionUnarchiveArgs, SectionDeleteArgs } from './sections.js';
|
|
13
13
|
import type { AcceptInvitationArgs, RejectInvitationArgs, BizAcceptInvitationArgs, BizRejectInvitationArgs } from './sharing.js';
|
|
14
|
+
import type { TaskAddArgs, TaskUpdateArgs, TaskCompleteArgs, TaskCompleteUndoArgs, TaskMoveArgs, TaskReorderArgs, TaskUncompleteArgs, TaskUpdateDateCompleteArgs, TaskDeleteArgs, TaskUpdateDayOrderArgs } from './tasks.js';
|
|
14
15
|
import type { ViewOptionsSetArgs, ViewOptionsDeleteArgs } from './view-options.js';
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
16
|
+
import type { WorkspaceFilterAddArgs, WorkspaceFilterUpdateArgs, WorkspaceFilterUpdateOrdersArgs, WorkspaceFilterDeleteArgs } from './workspace-filters.js';
|
|
17
|
+
import type { WorkspaceGoalAddArgs, WorkspaceGoalUpdateArgs, WorkspaceGoalDeleteArgs, WorkspaceGoalProjectAddArgs, WorkspaceGoalProjectRemoveArgs } from './workspace-goals.js';
|
|
18
|
+
import type { WorkspaceAddArgs, WorkspaceUpdateArgs, WorkspaceDeleteArgs, WorkspaceUpdateUserArgs, WorkspaceDeleteUserArgs, WorkspaceLeaveArgs, WorkspaceInviteArgs, WorkspaceSetDefaultOrderArgs, WorkspaceUpdateUserProjectSortPreferenceArgs } from './workspaces.js';
|
|
18
19
|
/**
|
|
19
20
|
* Maps each Sync API command type string to its corresponding argument type.
|
|
20
21
|
*
|
|
@@ -96,6 +97,13 @@ export type SyncCommandsMap = {
|
|
|
96
97
|
workspace_goal_delete: WorkspaceGoalDeleteArgs;
|
|
97
98
|
workspace_goal_project_add: WorkspaceGoalProjectAddArgs;
|
|
98
99
|
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;
|
|
99
107
|
live_notifications_mark_unread: LiveNotificationsMarkUnreadArgs;
|
|
100
108
|
live_notifications_mark_read: LiveNotificationsMarkReadArgs;
|
|
101
109
|
live_notifications_mark_read_all: LiveNotificationsMarkReadAllArgs;
|
|
@@ -163,6 +171,7 @@ export * from './workspaces.js';
|
|
|
163
171
|
export * from './folders.js';
|
|
164
172
|
export * from './workspace-filters.js';
|
|
165
173
|
export * from './workspace-goals.js';
|
|
174
|
+
export * from './goals.js';
|
|
166
175
|
export * from './notifications.js';
|
|
167
176
|
export * from './sharing.js';
|
|
168
177
|
export * from './view-options.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { ColorKey } from '../../../utils/colors.js';
|
|
1
2
|
import type { ProjectViewStyle, ProjectVisibility } from '../../projects/types.js';
|
|
2
3
|
import type { WorkspaceRole, CollaboratorRole } from '../../workspaces/types.js';
|
|
3
4
|
import type { ProjectStatus } from './shared.js';
|
|
4
|
-
import type { ColorKey } from '../../../utils/colors.js';
|
|
5
5
|
export type ProjectAccessConfig = {
|
|
6
6
|
visibility: ProjectVisibility;
|
|
7
7
|
configuration?: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SyncDueDate, ReminderService } from './shared.js';
|
|
2
1
|
import type { LocationTrigger, ReminderType } from '../resources/reminders.js';
|
|
2
|
+
import type { SyncDueDate, ReminderService } from './shared.js';
|
|
3
3
|
export type ReminderAddArgs = {
|
|
4
4
|
type: Extract<ReminderType, 'absolute'>;
|
|
5
5
|
itemId: string;
|
|
@@ -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", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
|
|
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", "goals", "day_orders", "calendars", "calendar_accounts", "suggestions", "tooltips"];
|
|
5
5
|
export type SyncResourceType = (typeof SYNC_RESOURCE_TYPES)[number];
|
|
@@ -0,0 +1,37 @@
|
|
|
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>;
|
|
@@ -5,6 +5,7 @@ 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';
|
|
8
9
|
export * from './calendars.js';
|
|
9
10
|
export * from './reminders.js';
|
|
10
11
|
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";
|
|
36
37
|
LABEL: "LABEL";
|
|
37
38
|
ASSIGNEE: "ASSIGNEE";
|
|
38
39
|
ADDED_DATE: "ADDED_DATE";
|
|
39
40
|
DUE_DATE: "DUE_DATE";
|
|
40
41
|
DEADLINE: "DEADLINE";
|
|
41
42
|
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,13 +47,13 @@ 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
|
-
|
|
50
|
+
WORKSPACE: "WORKSPACE";
|
|
51
51
|
ASSIGNEE: "ASSIGNEE";
|
|
52
52
|
ADDED_DATE: "ADDED_DATE";
|
|
53
53
|
DUE_DATE: "DUE_DATE";
|
|
54
54
|
DEADLINE: "DEADLINE";
|
|
55
55
|
PRIORITY: "PRIORITY";
|
|
56
|
-
|
|
56
|
+
MANUAL: "MANUAL";
|
|
57
57
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
58
58
|
}>>;
|
|
59
59
|
/** Available sort directions. */
|
|
@@ -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";
|
|
96
97
|
LABEL: "LABEL";
|
|
97
98
|
ASSIGNEE: "ASSIGNEE";
|
|
98
99
|
ADDED_DATE: "ADDED_DATE";
|
|
99
100
|
DUE_DATE: "DUE_DATE";
|
|
100
101
|
DEADLINE: "DEADLINE";
|
|
101
102
|
PRIORITY: "PRIORITY";
|
|
102
|
-
WORKSPACE: "WORKSPACE";
|
|
103
103
|
}>>>;
|
|
104
104
|
filteredBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
105
105
|
viewMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -110,13 +110,13 @@ 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
|
-
|
|
113
|
+
WORKSPACE: "WORKSPACE";
|
|
114
114
|
ASSIGNEE: "ASSIGNEE";
|
|
115
115
|
ADDED_DATE: "ADDED_DATE";
|
|
116
116
|
DUE_DATE: "DUE_DATE";
|
|
117
117
|
DEADLINE: "DEADLINE";
|
|
118
118
|
PRIORITY: "PRIORITY";
|
|
119
|
-
|
|
119
|
+
MANUAL: "MANUAL";
|
|
120
120
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
121
121
|
}>>>;
|
|
122
122
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -134,23 +134,23 @@ export declare const ProjectViewOptionsDefaultsSchema: z.ZodObject<{
|
|
|
134
134
|
}>>>;
|
|
135
135
|
groupedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
136
136
|
PROJECT: "PROJECT";
|
|
137
|
+
WORKSPACE: "WORKSPACE";
|
|
137
138
|
LABEL: "LABEL";
|
|
138
139
|
ASSIGNEE: "ASSIGNEE";
|
|
139
140
|
ADDED_DATE: "ADDED_DATE";
|
|
140
141
|
DUE_DATE: "DUE_DATE";
|
|
141
142
|
DEADLINE: "DEADLINE";
|
|
142
143
|
PRIORITY: "PRIORITY";
|
|
143
|
-
WORKSPACE: "WORKSPACE";
|
|
144
144
|
}>>>;
|
|
145
145
|
sortedBy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
146
146
|
PROJECT: "PROJECT";
|
|
147
|
-
|
|
147
|
+
WORKSPACE: "WORKSPACE";
|
|
148
148
|
ASSIGNEE: "ASSIGNEE";
|
|
149
149
|
ADDED_DATE: "ADDED_DATE";
|
|
150
150
|
DUE_DATE: "DUE_DATE";
|
|
151
151
|
DEADLINE: "DEADLINE";
|
|
152
152
|
PRIORITY: "PRIORITY";
|
|
153
|
-
|
|
153
|
+
MANUAL: "MANUAL";
|
|
154
154
|
ALPHABETICALLY: "ALPHABETICALLY";
|
|
155
155
|
}>>>;
|
|
156
156
|
sortOrder: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Label } from '../labels/types.js';
|
|
2
2
|
import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
|
|
3
3
|
import type { Section } from '../sections/types.js';
|
|
4
|
-
import type {
|
|
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, Calendar, CalendarAccount, Reminder, CompletedInfo, ViewOptions, ProjectViewOptionsDefaults, UserPlanLimits, LiveNotification, SyncWorkspace, SyncUser, UserSettings, LocationReminder, Suggestion } from './resources/index.js';
|
|
6
|
+
import type { Filter, Collaborator, CollaboratorState, Folder, Note, Tooltips, WorkspaceFilter, WorkspaceGoal, Goal, 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,6 +43,7 @@ export type SyncResponse = {
|
|
|
43
43
|
roleActions?: Record<string, unknown>[];
|
|
44
44
|
folders?: Folder[];
|
|
45
45
|
workspaceGoals?: WorkspaceGoal[];
|
|
46
|
+
goals?: Goal[];
|
|
46
47
|
dayOrders?: Record<string, number>;
|
|
47
48
|
calendars?: Calendar[];
|
|
48
49
|
calendarAccounts?: CalendarAccount[];
|