@doist/todoist-sdk 9.0.0 → 9.1.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.
Files changed (109) hide show
  1. package/dist/cjs/authentication.js +1 -0
  2. package/dist/cjs/clients/activity-client.js +63 -0
  3. package/dist/cjs/clients/app-client.js +347 -0
  4. package/dist/cjs/clients/backup-client.js +65 -0
  5. package/dist/cjs/clients/base-client.js +30 -0
  6. package/dist/cjs/clients/comment-client.js +92 -0
  7. package/dist/cjs/clients/email-client.js +43 -0
  8. package/dist/cjs/clients/folder-client.js +80 -0
  9. package/dist/cjs/clients/id-mapping-client.js +39 -0
  10. package/dist/cjs/clients/insights-client.js +88 -0
  11. package/dist/cjs/clients/label-client.js +127 -0
  12. package/dist/cjs/clients/productivity-client.js +27 -0
  13. package/dist/cjs/clients/project-client.js +232 -0
  14. package/dist/cjs/clients/reminder-client.js +198 -0
  15. package/dist/cjs/clients/section-client.js +118 -0
  16. package/dist/cjs/clients/task-client.js +255 -0
  17. package/dist/cjs/clients/template-client.js +89 -0
  18. package/dist/cjs/clients/ui-extension-client.js +109 -0
  19. package/dist/cjs/clients/upload-client.js +102 -0
  20. package/dist/cjs/clients/workspace-client.js +367 -0
  21. package/dist/cjs/consts/endpoints.js +66 -1
  22. package/dist/cjs/test-utils/test-defaults.js +77 -1
  23. package/dist/cjs/todoist-api.js +422 -1537
  24. package/dist/cjs/transport/http-client.js +1 -0
  25. package/dist/cjs/transport/sync-request.js +75 -0
  26. package/dist/cjs/types/apps/index.js +18 -0
  27. package/dist/cjs/types/apps/requests.js +2 -0
  28. package/dist/cjs/types/apps/types.js +253 -0
  29. package/dist/cjs/types/index.js +2 -0
  30. package/dist/cjs/types/ui-extensions/index.js +18 -0
  31. package/dist/cjs/types/ui-extensions/requests.js +2 -0
  32. package/dist/cjs/types/ui-extensions/types.js +77 -0
  33. package/dist/cjs/utils/headers.js +16 -0
  34. package/dist/cjs/utils/request-helpers.js +21 -0
  35. package/dist/cjs/utils/validators.js +52 -38
  36. package/dist/esm/authentication.js +1 -0
  37. package/dist/esm/clients/activity-client.js +59 -0
  38. package/dist/esm/clients/app-client.js +343 -0
  39. package/dist/esm/clients/backup-client.js +61 -0
  40. package/dist/esm/clients/base-client.js +26 -0
  41. package/dist/esm/clients/comment-client.js +88 -0
  42. package/dist/esm/clients/email-client.js +39 -0
  43. package/dist/esm/clients/folder-client.js +76 -0
  44. package/dist/esm/clients/id-mapping-client.js +35 -0
  45. package/dist/esm/clients/insights-client.js +84 -0
  46. package/dist/esm/clients/label-client.js +123 -0
  47. package/dist/esm/clients/productivity-client.js +23 -0
  48. package/dist/esm/clients/project-client.js +228 -0
  49. package/dist/esm/clients/reminder-client.js +194 -0
  50. package/dist/esm/clients/section-client.js +114 -0
  51. package/dist/esm/clients/task-client.js +251 -0
  52. package/dist/esm/clients/template-client.js +85 -0
  53. package/dist/esm/clients/ui-extension-client.js +105 -0
  54. package/dist/esm/clients/upload-client.js +98 -0
  55. package/dist/esm/clients/workspace-client.js +363 -0
  56. package/dist/esm/consts/endpoints.js +51 -0
  57. package/dist/esm/test-utils/test-defaults.js +75 -0
  58. package/dist/esm/todoist-api.js +425 -1540
  59. package/dist/esm/transport/http-client.js +1 -0
  60. package/dist/esm/transport/sync-request.js +72 -0
  61. package/dist/esm/types/apps/index.js +2 -0
  62. package/dist/esm/types/apps/requests.js +1 -0
  63. package/dist/esm/types/apps/types.js +248 -0
  64. package/dist/esm/types/index.js +2 -0
  65. package/dist/esm/types/ui-extensions/index.js +2 -0
  66. package/dist/esm/types/ui-extensions/requests.js +1 -0
  67. package/dist/esm/types/ui-extensions/types.js +74 -0
  68. package/dist/esm/utils/headers.js +13 -0
  69. package/dist/esm/utils/request-helpers.js +17 -0
  70. package/dist/esm/utils/validators.js +14 -0
  71. package/dist/types/authentication.d.ts +1 -1
  72. package/dist/types/clients/activity-client.d.ts +12 -0
  73. package/dist/types/clients/app-client.d.ts +37 -0
  74. package/dist/types/clients/backup-client.d.ts +14 -0
  75. package/dist/types/clients/base-client.d.ts +21 -0
  76. package/dist/types/clients/comment-client.d.ts +15 -0
  77. package/dist/types/clients/email-client.d.ts +13 -0
  78. package/dist/types/clients/folder-client.d.ts +16 -0
  79. package/dist/types/clients/id-mapping-client.d.ts +13 -0
  80. package/dist/types/clients/insights-client.d.ts +18 -0
  81. package/dist/types/clients/label-client.d.ts +19 -0
  82. package/dist/types/clients/productivity-client.d.ts +12 -0
  83. package/dist/types/clients/project-client.d.ts +26 -0
  84. package/dist/types/clients/reminder-client.d.ts +25 -0
  85. package/dist/types/clients/section-client.d.ts +18 -0
  86. package/dist/types/clients/task-client.d.ts +25 -0
  87. package/dist/types/clients/template-client.d.ts +17 -0
  88. package/dist/types/clients/ui-extension-client.d.ts +18 -0
  89. package/dist/types/clients/upload-client.d.ts +17 -0
  90. package/dist/types/clients/workspace-client.d.ts +43 -0
  91. package/dist/types/consts/endpoints.d.ts +24 -0
  92. package/dist/types/test-utils/test-defaults.d.ts +16 -1
  93. package/dist/types/todoist-api.d.ts +238 -17
  94. package/dist/types/transport/sync-request.d.ts +27 -0
  95. package/dist/types/types/apps/index.d.ts +2 -0
  96. package/dist/types/types/apps/requests.d.ts +89 -0
  97. package/dist/types/types/apps/types.d.ts +414 -0
  98. package/dist/types/types/http.d.ts +8 -1
  99. package/dist/types/types/index.d.ts +2 -0
  100. package/dist/types/types/sync/resources/user.d.ts +2 -2
  101. package/dist/types/types/sync/response.d.ts +2 -2
  102. package/dist/types/types/sync/user-preferences.d.ts +1 -1
  103. package/dist/types/types/ui-extensions/index.d.ts +2 -0
  104. package/dist/types/types/ui-extensions/requests.d.ts +108 -0
  105. package/dist/types/types/ui-extensions/types.d.ts +185 -0
  106. package/dist/types/utils/headers.d.ts +7 -0
  107. package/dist/types/utils/request-helpers.d.ts +13 -0
  108. package/dist/types/utils/validators.d.ts +223 -0
  109. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ import type { Permission } from '../../authentication.js';
2
+ import type { AppIconSize } from '../../consts/endpoints.js';
3
+ import type { InstallationType, WebhookEvent, WebhookVersion } from './types.js';
4
+ /**
5
+ * Arguments for creating a new developer application.
6
+ */
7
+ export type AddAppArgs = {
8
+ /** Display name of the application. */
9
+ displayName: string;
10
+ /** The application's service URL. */
11
+ serviceUrl: string;
12
+ };
13
+ /**
14
+ * Arguments for updating a developer application.
15
+ * All fields are optional — only provided fields are updated.
16
+ *
17
+ * Pass `appTokenScopes` as an array (e.g. `['data:read', 'task:add']`);
18
+ * the SDK serializes it to the comma-separated string the backend expects.
19
+ */
20
+ export type UpdateAppArgs = {
21
+ /** Updated display name. */
22
+ displayName?: string;
23
+ /** Updated OAuth redirect URI. Pass `null` to clear. */
24
+ oauthRedirectUri?: string | null;
25
+ /** Updated service URL. */
26
+ serviceUrl?: string;
27
+ /** Updated app description. */
28
+ description?: string;
29
+ /**
30
+ * Updated list of scopes the app may request. Pass `null` to clear.
31
+ *
32
+ * Typed as `Permission | (string & {})` so known scopes get autocomplete
33
+ * while still permitting plain strings — needed so a fetched
34
+ * `App['appTokenScopes']` (typed `string[] | null`) can be passed back
35
+ * to `updateApp()` without casts.
36
+ */
37
+ appTokenScopes?: readonly (Permission | (string & {}))[] | null;
38
+ };
39
+ /**
40
+ * Arguments for uploading an app icon.
41
+ */
42
+ export type UploadAppIconArgs = {
43
+ /** The application ID. */
44
+ appId: string;
45
+ /** The icon file to upload (Buffer, Stream, or file path). */
46
+ file: Buffer | NodeJS.ReadableStream | string | Blob;
47
+ /** The file name (required for Buffer/Stream uploads). */
48
+ fileName?: string;
49
+ /** Icon size variant. Defaults to `'medium'`. */
50
+ size?: AppIconSize;
51
+ };
52
+ /**
53
+ * Arguments for configuring (creating or updating) an app webhook.
54
+ */
55
+ export type UpdateAppWebhookArgs = {
56
+ /** The application ID. */
57
+ appId: string;
58
+ /** The URL the webhook will POST events to. */
59
+ callbackUrl: string;
60
+ /** Events the webhook should receive. Must be unique. */
61
+ events: readonly WebhookEvent[];
62
+ /** Webhook payload version. Defaults to the backend's latest supported version. */
63
+ version?: WebhookVersion;
64
+ };
65
+ /**
66
+ * Arguments for installing a developer application via its distribution token.
67
+ */
68
+ export type InstallAppArgs = {
69
+ /** The distribution token for the app being installed. */
70
+ distributionToken: string;
71
+ /** Type of installation to create. */
72
+ installationType: InstallationType;
73
+ /** Whether the requesting client has validated the app's requested scopes with the user. */
74
+ appTokenScopesValidated?: boolean;
75
+ };
76
+ /**
77
+ * Arguments for updating an app installation.
78
+ */
79
+ export type UpdateAppInstallationArgs = {
80
+ /** Updated validated-scopes flag. */
81
+ appTokenScopesValidated?: boolean;
82
+ };
83
+ /**
84
+ * Arguments for revoking a user's authorization of a third-party app.
85
+ */
86
+ export type RevokeUserAuthorizationArgs = {
87
+ /** The ID of the access token to revoke. */
88
+ accessTokenId: string;
89
+ };
@@ -0,0 +1,414 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Available statuses for a developer application.
4
+ */
5
+ export declare const APP_STATUSES: readonly ["public"];
6
+ /**
7
+ * Status of a developer application.
8
+ */
9
+ export type AppStatus = (typeof APP_STATUSES)[number];
10
+ export declare const AppStatusSchema: z.ZodEnum<{
11
+ public: "public";
12
+ }>;
13
+ /**
14
+ * Webhook event types that can be subscribed to.
15
+ *
16
+ * These are the friendly public names the backend uses in webhook payloads.
17
+ * The on-the-wire config endpoint uses a different (legacy) form (see
18
+ * {@link WEBHOOK_EVENT_WIRE_NAMES}); the SDK converts between the two
19
+ * so consumers only ever work with these pretty names.
20
+ *
21
+ * @see https://developer.todoist.com/sync/v1/#webhooks
22
+ */
23
+ export declare const WEBHOOK_EVENTS: readonly ["item:added", "item:updated", "item:completed", "item:uncompleted", "item:deleted", "note:added", "note:updated", "note:deleted", "project:added", "project:updated", "project:deleted", "project:archived", "project:unarchived", "section:added", "section:updated", "section:deleted", "section:archived", "section:unarchived", "label:added", "label:updated", "label:deleted", "filter:added", "filter:updated", "filter:deleted", "reminder:fired"];
24
+ /**
25
+ * A webhook event that can be subscribed to.
26
+ */
27
+ export type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
28
+ export declare const WebhookEventSchema: z.ZodEnum<{
29
+ "project:added": "project:added";
30
+ "project:updated": "project:updated";
31
+ "project:deleted": "project:deleted";
32
+ "project:archived": "project:archived";
33
+ "project:unarchived": "project:unarchived";
34
+ "item:added": "item:added";
35
+ "item:updated": "item:updated";
36
+ "item:completed": "item:completed";
37
+ "item:uncompleted": "item:uncompleted";
38
+ "item:deleted": "item:deleted";
39
+ "note:added": "note:added";
40
+ "note:updated": "note:updated";
41
+ "note:deleted": "note:deleted";
42
+ "section:added": "section:added";
43
+ "section:updated": "section:updated";
44
+ "section:deleted": "section:deleted";
45
+ "section:archived": "section:archived";
46
+ "section:unarchived": "section:unarchived";
47
+ "label:added": "label:added";
48
+ "label:updated": "label:updated";
49
+ "label:deleted": "label:deleted";
50
+ "filter:added": "filter:added";
51
+ "filter:updated": "filter:updated";
52
+ "filter:deleted": "filter:deleted";
53
+ "reminder:fired": "reminder:fired";
54
+ }>;
55
+ /**
56
+ * Raw wire-format webhook event names used by the config endpoint
57
+ * (`POST/GET /apps/<id>/webhook`). Exported for completeness — prefer
58
+ * {@link WEBHOOK_EVENTS} when working with the SDK.
59
+ */
60
+ export declare const WEBHOOK_EVENT_WIRE_NAMES: readonly ["e_item_added", "e_item_updated", "e_item_completed", "e_item_uncompleted", "e_item_deleted", "e_note_added", "e_note_updated", "e_note_deleted", "e_project_added", "e_project_updated", "e_project_deleted", "e_project_archived", "e_project_unarchived", "e_section_added", "e_section_updated", "e_section_deleted", "e_section_archived", "e_section_unarchived", "e_label_added", "e_label_updated", "e_label_deleted", "e_filter_added", "e_filter_updated", "e_filter_deleted", "e_reminder_fired"];
61
+ /**
62
+ * Wire-format webhook event name (the `e_*` form).
63
+ */
64
+ export type WebhookEventWireName = (typeof WEBHOOK_EVENT_WIRE_NAMES)[number];
65
+ export declare const WebhookEventWireNameSchema: z.ZodEnum<{
66
+ e_item_added: "e_item_added";
67
+ e_item_updated: "e_item_updated";
68
+ e_item_completed: "e_item_completed";
69
+ e_item_uncompleted: "e_item_uncompleted";
70
+ e_item_deleted: "e_item_deleted";
71
+ e_note_added: "e_note_added";
72
+ e_note_updated: "e_note_updated";
73
+ e_note_deleted: "e_note_deleted";
74
+ e_project_added: "e_project_added";
75
+ e_project_updated: "e_project_updated";
76
+ e_project_deleted: "e_project_deleted";
77
+ e_project_archived: "e_project_archived";
78
+ e_project_unarchived: "e_project_unarchived";
79
+ e_section_added: "e_section_added";
80
+ e_section_updated: "e_section_updated";
81
+ e_section_deleted: "e_section_deleted";
82
+ e_section_archived: "e_section_archived";
83
+ e_section_unarchived: "e_section_unarchived";
84
+ e_label_added: "e_label_added";
85
+ e_label_updated: "e_label_updated";
86
+ e_label_deleted: "e_label_deleted";
87
+ e_filter_added: "e_filter_added";
88
+ e_filter_updated: "e_filter_updated";
89
+ e_filter_deleted: "e_filter_deleted";
90
+ e_reminder_fired: "e_reminder_fired";
91
+ }>;
92
+ /**
93
+ * Translates a wire-format event name (`'e_item_added'`) to its pretty form (`'item:added'`).
94
+ */
95
+ export declare function webhookEventFromWireName(wireName: WebhookEventWireName): WebhookEvent;
96
+ /**
97
+ * Translates a pretty event name (`'item:added'`) to its wire-format form (`'e_item_added'`).
98
+ */
99
+ export declare function webhookEventToWireName(event: WebhookEvent): WebhookEventWireName;
100
+ /**
101
+ * Available statuses for an app webhook.
102
+ */
103
+ export declare const WEBHOOK_STATUSES: readonly ["active", "invalid"];
104
+ /**
105
+ * Delivery status of an app webhook.
106
+ */
107
+ export type WebhookStatus = (typeof WEBHOOK_STATUSES)[number];
108
+ export declare const WebhookStatusSchema: z.ZodEnum<{
109
+ active: "active";
110
+ invalid: "invalid";
111
+ }>;
112
+ /**
113
+ * Supported webhook payload versions. v9 is deprecated and intentionally excluded.
114
+ */
115
+ export declare const WEBHOOK_VERSIONS: readonly ["1"];
116
+ /**
117
+ * Webhook payload version.
118
+ */
119
+ export type WebhookVersion = (typeof WEBHOOK_VERSIONS)[number];
120
+ export declare const WebhookVersionSchema: z.ZodEnum<{
121
+ 1: "1";
122
+ }>;
123
+ /**
124
+ * Available installation types for an app installation.
125
+ */
126
+ export declare const INSTALLATION_TYPES: readonly ["user"];
127
+ /**
128
+ * Scope of an app installation.
129
+ */
130
+ export type InstallationType = (typeof INSTALLATION_TYPES)[number];
131
+ export declare const InstallationTypeSchema: z.ZodEnum<{
132
+ user: "user";
133
+ }>;
134
+ /**
135
+ * Transforms a comma-separated scope string into `string[] | null`.
136
+ *
137
+ * The backend stores `app_token_scopes` as a single comma-separated string
138
+ * (e.g. `"data:read,task:add"`). Reads are exposed as `string[]` (rather than
139
+ * `Permission[]`) so that newly added backend scopes don't break parsing —
140
+ * writes accept `Permission` for autocomplete while still permitting `string`
141
+ * (via `UpdateAppArgs`), so a fetched `App.appTokenScopes` can be round-tripped
142
+ * back into `updateApp()` without casts.
143
+ *
144
+ * Preserves `null` on read (backend returns `null` for apps that have had
145
+ * their scopes cleared via `updateApp({ appTokenScopes: null })`) so the
146
+ * read and write shapes line up and information is not lost.
147
+ */
148
+ export declare const AppTokenScopesSchema: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
149
+ /**
150
+ * Schema for a developer application.
151
+ * @see https://developer.todoist.com/api/v1/#tag/Apps
152
+ */
153
+ export declare const AppSchema: z.ZodObject<{
154
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
155
+ status: z.ZodEnum<{
156
+ public: "public";
157
+ }>;
158
+ displayName: z.ZodString;
159
+ userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
160
+ createdAt: z.ZodCoercedDate<unknown>;
161
+ serviceUrl: z.ZodNullable<z.ZodString>;
162
+ oauthRedirectUri: z.ZodNullable<z.ZodString>;
163
+ description: z.ZodNullable<z.ZodString>;
164
+ iconSm: z.ZodNullable<z.ZodString>;
165
+ iconMd: z.ZodNullable<z.ZodString>;
166
+ iconLg: z.ZodNullable<z.ZodString>;
167
+ appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
168
+ }, z.core.$strip>;
169
+ /**
170
+ * A developer application.
171
+ */
172
+ export type App = z.infer<typeof AppSchema>;
173
+ /**
174
+ * Schema for a developer application that includes the user count.
175
+ * Returned by most endpoints that manage a single app (get, update, delete).
176
+ */
177
+ export declare const AppWithUserCountSchema: z.ZodObject<{
178
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
179
+ status: z.ZodEnum<{
180
+ public: "public";
181
+ }>;
182
+ displayName: z.ZodString;
183
+ userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
184
+ createdAt: z.ZodCoercedDate<unknown>;
185
+ serviceUrl: z.ZodNullable<z.ZodString>;
186
+ oauthRedirectUri: z.ZodNullable<z.ZodString>;
187
+ description: z.ZodNullable<z.ZodString>;
188
+ iconSm: z.ZodNullable<z.ZodString>;
189
+ iconMd: z.ZodNullable<z.ZodString>;
190
+ iconLg: z.ZodNullable<z.ZodString>;
191
+ appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
192
+ userCount: z.ZodNumber;
193
+ }, z.core.$strip>;
194
+ /**
195
+ * A developer application with authorized user count.
196
+ */
197
+ export type AppWithUserCount = z.infer<typeof AppWithUserCountSchema>;
198
+ /**
199
+ * OAuth client credentials for a developer application.
200
+ */
201
+ export declare const AppSecretsSchema: z.ZodObject<{
202
+ clientId: z.ZodString;
203
+ clientSecret: z.ZodString;
204
+ }, z.core.$strip>;
205
+ /**
206
+ * OAuth client credentials for a developer application.
207
+ */
208
+ export type AppSecrets = z.infer<typeof AppSecretsSchema>;
209
+ /**
210
+ * Webhook verification token for a developer application.
211
+ */
212
+ export declare const AppVerificationTokenSchema: z.ZodObject<{
213
+ verificationToken: z.ZodString;
214
+ }, z.core.$strip>;
215
+ /**
216
+ * Webhook verification token for a developer application.
217
+ */
218
+ export type AppVerificationToken = z.infer<typeof AppVerificationTokenSchema>;
219
+ /**
220
+ * Developer test access token for a developer application.
221
+ */
222
+ export declare const AppTestTokenSchema: z.ZodObject<{
223
+ accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
224
+ }, z.core.$strip>;
225
+ /**
226
+ * Developer test access token for a developer application.
227
+ */
228
+ export type AppTestToken = z.infer<typeof AppTestTokenSchema>;
229
+ /**
230
+ * Distribution token for a developer application.
231
+ */
232
+ export declare const AppDistributionTokenSchema: z.ZodObject<{
233
+ distributionToken: z.ZodString;
234
+ }, z.core.$strip>;
235
+ /**
236
+ * Distribution token for a developer application.
237
+ */
238
+ export type AppDistributionToken = z.infer<typeof AppDistributionTokenSchema>;
239
+ /**
240
+ * Subset of an app returned when resolving by distribution token — used by the installation flow.
241
+ * Includes a lightweight list of the app's UI extensions (not full `UIExtension` records).
242
+ */
243
+ export declare const AppByDistributionTokenUiExtensionSchema: z.ZodObject<{
244
+ name: z.ZodString;
245
+ description: z.ZodString;
246
+ icon: z.ZodNullable<z.ZodString>;
247
+ extensionType: z.ZodEnum<{
248
+ "context-menu": "context-menu";
249
+ composer: "composer";
250
+ settings: "settings";
251
+ }>;
252
+ }, z.core.$strip>;
253
+ /**
254
+ * UI extension metadata returned by the `by_distribution_token` endpoint.
255
+ */
256
+ export type AppByDistributionTokenUiExtension = z.infer<typeof AppByDistributionTokenUiExtensionSchema>;
257
+ export declare const AppByDistributionTokenSchema: z.ZodObject<{
258
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
259
+ displayName: z.ZodString;
260
+ description: z.ZodNullable<z.ZodString>;
261
+ iconMd: z.ZodNullable<z.ZodString>;
262
+ appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
263
+ uiExtensions: z.ZodArray<z.ZodObject<{
264
+ name: z.ZodString;
265
+ description: z.ZodString;
266
+ icon: z.ZodNullable<z.ZodString>;
267
+ extensionType: z.ZodEnum<{
268
+ "context-menu": "context-menu";
269
+ composer: "composer";
270
+ settings: "settings";
271
+ }>;
272
+ }, z.core.$strip>>;
273
+ }, z.core.$strip>;
274
+ /**
275
+ * Public-facing app info resolved via distribution token — used during installation.
276
+ */
277
+ export type AppByDistributionToken = z.infer<typeof AppByDistributionTokenSchema>;
278
+ /**
279
+ * Schema for an app webhook.
280
+ *
281
+ * Events arrive from the wire in their `e_*` form and are transformed to
282
+ * their pretty `item:added`-style names for SDK consumers.
283
+ */
284
+ export declare const AppWebhookSchema: z.ZodObject<{
285
+ status: z.ZodEnum<{
286
+ active: "active";
287
+ invalid: "invalid";
288
+ }>;
289
+ callbackUrl: z.ZodString;
290
+ version: z.ZodEnum<{
291
+ 1: "1";
292
+ }>;
293
+ events: z.ZodArray<z.ZodPipe<z.ZodEnum<{
294
+ e_item_added: "e_item_added";
295
+ e_item_updated: "e_item_updated";
296
+ e_item_completed: "e_item_completed";
297
+ e_item_uncompleted: "e_item_uncompleted";
298
+ e_item_deleted: "e_item_deleted";
299
+ e_note_added: "e_note_added";
300
+ e_note_updated: "e_note_updated";
301
+ e_note_deleted: "e_note_deleted";
302
+ e_project_added: "e_project_added";
303
+ e_project_updated: "e_project_updated";
304
+ e_project_deleted: "e_project_deleted";
305
+ e_project_archived: "e_project_archived";
306
+ e_project_unarchived: "e_project_unarchived";
307
+ e_section_added: "e_section_added";
308
+ e_section_updated: "e_section_updated";
309
+ e_section_deleted: "e_section_deleted";
310
+ e_section_archived: "e_section_archived";
311
+ e_section_unarchived: "e_section_unarchived";
312
+ e_label_added: "e_label_added";
313
+ e_label_updated: "e_label_updated";
314
+ e_label_deleted: "e_label_deleted";
315
+ e_filter_added: "e_filter_added";
316
+ e_filter_updated: "e_filter_updated";
317
+ e_filter_deleted: "e_filter_deleted";
318
+ e_reminder_fired: "e_reminder_fired";
319
+ }>, z.ZodTransform<"project:added" | "project:updated" | "project:deleted" | "project:archived" | "project:unarchived" | "item:added" | "item:updated" | "item:completed" | "item:uncompleted" | "item:deleted" | "note:added" | "note:updated" | "note:deleted" | "section:added" | "section:updated" | "section:deleted" | "section:archived" | "section:unarchived" | "label:added" | "label:updated" | "label:deleted" | "filter:added" | "filter:updated" | "filter:deleted" | "reminder:fired", "e_item_added" | "e_item_updated" | "e_item_completed" | "e_item_uncompleted" | "e_item_deleted" | "e_note_added" | "e_note_updated" | "e_note_deleted" | "e_project_added" | "e_project_updated" | "e_project_deleted" | "e_project_archived" | "e_project_unarchived" | "e_section_added" | "e_section_updated" | "e_section_deleted" | "e_section_archived" | "e_section_unarchived" | "e_label_added" | "e_label_updated" | "e_label_deleted" | "e_filter_added" | "e_filter_updated" | "e_filter_deleted" | "e_reminder_fired">>>;
320
+ }, z.core.$strip>;
321
+ /**
322
+ * Webhook configuration for a developer application.
323
+ */
324
+ export type AppWebhook = z.infer<typeof AppWebhookSchema>;
325
+ /**
326
+ * Lightweight view of an app embedded in an installation record.
327
+ * Mirrors `AppSchema` shape — backend returns the same `ApplicationRestView`.
328
+ */
329
+ export declare const InstalledIntegrationSchema: z.ZodObject<{
330
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
331
+ status: z.ZodEnum<{
332
+ public: "public";
333
+ }>;
334
+ displayName: z.ZodString;
335
+ userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
336
+ createdAt: z.ZodCoercedDate<unknown>;
337
+ serviceUrl: z.ZodNullable<z.ZodString>;
338
+ oauthRedirectUri: z.ZodNullable<z.ZodString>;
339
+ description: z.ZodNullable<z.ZodString>;
340
+ iconSm: z.ZodNullable<z.ZodString>;
341
+ iconMd: z.ZodNullable<z.ZodString>;
342
+ iconLg: z.ZodNullable<z.ZodString>;
343
+ appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
344
+ }, z.core.$strip>;
345
+ /**
346
+ * Embedded app info on an installation record.
347
+ */
348
+ export type InstalledIntegration = z.infer<typeof InstalledIntegrationSchema>;
349
+ /**
350
+ * Schema for an installed application (integration installed to a user's account).
351
+ */
352
+ export declare const AppInstallationSchema: z.ZodObject<{
353
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
354
+ creator: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
355
+ createdTs: z.ZodNumber;
356
+ installationType: z.ZodEnum<{
357
+ user: "user";
358
+ }>;
359
+ appTokenScopesValidated: z.ZodBoolean;
360
+ integration: z.ZodNullable<z.ZodObject<{
361
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
362
+ status: z.ZodEnum<{
363
+ public: "public";
364
+ }>;
365
+ displayName: z.ZodString;
366
+ userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
367
+ createdAt: z.ZodCoercedDate<unknown>;
368
+ serviceUrl: z.ZodNullable<z.ZodString>;
369
+ oauthRedirectUri: z.ZodNullable<z.ZodString>;
370
+ description: z.ZodNullable<z.ZodString>;
371
+ iconSm: z.ZodNullable<z.ZodString>;
372
+ iconMd: z.ZodNullable<z.ZodString>;
373
+ iconLg: z.ZodNullable<z.ZodString>;
374
+ appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
375
+ }, z.core.$strip>>;
376
+ }, z.core.$strip>;
377
+ /**
378
+ * Installation of a developer application on a user's account.
379
+ */
380
+ export type AppInstallation = z.infer<typeof AppInstallationSchema>;
381
+ /**
382
+ * Lightweight app info included on a user authorization record.
383
+ */
384
+ export declare const UserAuthorizationAppSchema: z.ZodObject<{
385
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
386
+ displayName: z.ZodString;
387
+ description: z.ZodNullable<z.ZodString>;
388
+ serviceUrl: z.ZodNullable<z.ZodString>;
389
+ iconMd: z.ZodNullable<z.ZodString>;
390
+ }, z.core.$strip>;
391
+ /**
392
+ * App info attached to a user authorization entry.
393
+ */
394
+ export type UserAuthorizationApp = z.infer<typeof UserAuthorizationAppSchema>;
395
+ /**
396
+ * Schema for a user authorization entry — a token the user has granted to a third-party app.
397
+ */
398
+ export declare const UserAuthorizationSchema: z.ZodObject<{
399
+ accessTokenId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
400
+ scope: z.ZodArray<z.ZodString>;
401
+ scopeDescriptions: z.ZodArray<z.ZodString>;
402
+ createdAt: z.ZodCoercedDate<unknown>;
403
+ app: z.ZodNullable<z.ZodObject<{
404
+ id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
405
+ displayName: z.ZodString;
406
+ description: z.ZodNullable<z.ZodString>;
407
+ serviceUrl: z.ZodNullable<z.ZodString>;
408
+ iconMd: z.ZodNullable<z.ZodString>;
409
+ }, z.core.$strip>>;
410
+ }, z.core.$strip>;
411
+ /**
412
+ * A user authorization entry (access token granted to a third-party app).
413
+ */
414
+ export type UserAuthorization = z.infer<typeof UserAuthorizationSchema>;
@@ -1,4 +1,4 @@
1
- export type HttpMethod = 'POST' | 'GET' | 'DELETE' | 'PUT';
1
+ export type HttpMethod = 'POST' | 'GET' | 'DELETE' | 'PUT' | 'PATCH';
2
2
  /**
3
3
  * HTTP response type that replaces AxiosResponse
4
4
  */
@@ -83,3 +83,10 @@ export type CustomFetchResponse = {
83
83
  export type CustomFetch = (url: string, options?: RequestInit & {
84
84
  timeout?: number;
85
85
  }) => Promise<CustomFetchResponse>;
86
+ /**
87
+ * Response from a binary file endpoint (e.g. attachment view, backup download),
88
+ * extending CustomFetchResponse with `arrayBuffer()` support for binary content.
89
+ */
90
+ export type FileResponse = CustomFetchResponse & {
91
+ arrayBuffer(): Promise<ArrayBuffer>;
92
+ };
@@ -18,3 +18,5 @@ export * from './templates/index.js';
18
18
  export * from './errors.js';
19
19
  export * from './http.js';
20
20
  export * from './sync/index.js';
21
+ export * from './apps/index.js';
22
+ export * from './ui-extensions/index.js';
@@ -89,7 +89,7 @@ export declare const SyncUserSchema: z.ZodObject<{
89
89
  mfaEnabled: z.ZodOptional<z.ZodBoolean>;
90
90
  mobileHost: z.ZodNullable<z.ZodString>;
91
91
  mobileNumber: z.ZodNullable<z.ZodString>;
92
- nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
92
+ nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 4 | 5 | 6 | 7>>;
93
93
  onboardingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
94
94
  onboardingRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
95
95
  onboardingPersona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -113,7 +113,7 @@ export declare const SyncUserSchema: z.ZodObject<{
113
113
  }, z.core.$strip>>>;
114
114
  shareLimit: z.ZodNumber;
115
115
  sortOrder: z.ZodNumber;
116
- startDay: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
116
+ startDay: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 4 | 5 | 6 | 7>>;
117
117
  startPage: z.ZodString;
118
118
  themeId: z.ZodString;
119
119
  timeFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
@@ -417,7 +417,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
417
417
  mfaEnabled: z.ZodOptional<z.ZodBoolean>;
418
418
  mobileHost: z.ZodNullable<z.ZodString>;
419
419
  mobileNumber: z.ZodNullable<z.ZodString>;
420
- nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
420
+ nextWeek: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 4 | 5 | 6 | 7>>;
421
421
  onboardingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
422
422
  onboardingRole: z.ZodOptional<z.ZodNullable<z.ZodString>>;
423
423
  onboardingPersona: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -441,7 +441,7 @@ export declare const SyncResponseSchema: z.ZodObject<{
441
441
  }, z.core.$strip>>>;
442
442
  shareLimit: z.ZodNumber;
443
443
  sortOrder: z.ZodNumber;
444
- startDay: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
444
+ startDay: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 4 | 5 | 6 | 7>>;
445
445
  startPage: z.ZodString;
446
446
  themeId: z.ZodString;
447
447
  timeFormat: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
@@ -36,4 +36,4 @@ export declare const BooleanFromZeroOneSchema: z.ZodPipe<z.ZodUnion<readonly [z.
36
36
  /** Zod read-schemas: parse API numbers, emit descriptive strings */
37
37
  export declare const DateFormatSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"DD/MM/YYYY" | "MM/DD/YYYY", 0 | 1>>;
38
38
  export declare const TimeFormatSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>]>, z.ZodTransform<"24h" | "12h", 0 | 1>>;
39
- export declare const DayOfWeekSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 2 | 1 | 3 | 4 | 5 | 6 | 7>>;
39
+ export declare const DayOfWeekSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<4>, z.ZodLiteral<5>, z.ZodLiteral<6>, z.ZodLiteral<7>]>, z.ZodTransform<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", 3 | 2 | 1 | 4 | 5 | 6 | 7>>;
@@ -0,0 +1,2 @@
1
+ export * from './types.js';
2
+ export * from './requests.js';