@todoist/sdk 18.0.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -297,6 +297,7 @@ export const DEFAULT_APP = {
297
297
  iconMd: 'https://example.com/icon-md.png',
298
298
  iconLg: 'https://example.com/icon-lg.png',
299
299
  appTokenScopes: ['data:read', 'task:add'],
300
+ clientType: 'confidential',
300
301
  };
301
302
  export const DEFAULT_APP_WITH_USER_COUNT = Object.assign(Object.assign({}, DEFAULT_APP), { userCount: 12 });
302
303
  export const DEFAULT_APP_SECRETS = {
@@ -130,6 +130,11 @@ export const AppTokenScopesSchema = z
130
130
  return [];
131
131
  return value.split(',').filter(Boolean);
132
132
  });
133
+ /**
134
+ * Available OAuth client types for a developer application (RFC 6749 §2.1).
135
+ */
136
+ export const APP_CLIENT_TYPES = ['confidential', 'public'];
137
+ export const AppClientTypeSchema = z.enum(APP_CLIENT_TYPES);
133
138
  /**
134
139
  * Schema for a developer application.
135
140
  * @see https://developer.todoist.com/api/v1/#tag/Apps
@@ -148,6 +153,7 @@ export const AppSchema = z.object({
148
153
  iconMd: z.string().nullable(),
149
154
  iconLg: z.string().nullable(),
150
155
  appTokenScopes: AppTokenScopesSchema,
156
+ clientType: AppClientTypeSchema,
151
157
  });
152
158
  /**
153
159
  * Schema for a developer application that includes the user count.
@@ -1,6 +1,6 @@
1
1
  import type { Permission } from '../../authentication.js';
2
2
  import type { AppIconSize } from '../../consts/endpoints.js';
3
- import type { InstallationType, WebhookEvent, WebhookVersion } from './types.js';
3
+ import type { AppClientType, InstallationType, WebhookEvent, WebhookVersion } from './types.js';
4
4
  /**
5
5
  * Arguments for creating a new developer application.
6
6
  */
@@ -35,6 +35,16 @@ export type UpdateAppArgs = {
35
35
  * to `updateApp()` without casts.
36
36
  */
37
37
  appTokenScopes?: readonly (Permission | (string & {}))[] | null;
38
+ /**
39
+ * Updated OAuth client type. Set to `'public'` for apps that cannot keep a
40
+ * secret (native apps, browser extensions, CLIs), so they exchange
41
+ * authorization codes with PKCE alone. The client secret is kept, so
42
+ * switching back to `'confidential'` needs no new one.
43
+ *
44
+ * Dynamically registered clients cannot change it: the API rejects the
45
+ * update with `BAD_REQUEST`.
46
+ */
47
+ clientType?: AppClientType;
38
48
  };
39
49
  /**
40
50
  * Arguments for uploading an app icon.
@@ -146,6 +146,22 @@ export declare const InstallationTypeSchema: z.ZodEnum<{
146
146
  * read and write shapes line up and information is not lost.
147
147
  */
148
148
  export declare const AppTokenScopesSchema: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
149
+ /**
150
+ * Available OAuth client types for a developer application (RFC 6749 §2.1).
151
+ */
152
+ export declare const APP_CLIENT_TYPES: readonly ["confidential", "public"];
153
+ /**
154
+ * OAuth client type of a developer application: whether it can keep a client secret.
155
+ *
156
+ * - `confidential` apps authenticate with their client secret at the token endpoint.
157
+ * - `public` apps (native apps, browser extensions, CLIs) cannot keep a secret: they
158
+ * must use PKCE, and exchange authorization codes with the `code_verifier` alone.
159
+ */
160
+ export type AppClientType = (typeof APP_CLIENT_TYPES)[number];
161
+ export declare const AppClientTypeSchema: z.ZodEnum<{
162
+ public: "public";
163
+ confidential: "confidential";
164
+ }>;
149
165
  /**
150
166
  * Schema for a developer application.
151
167
  * @see https://developer.todoist.com/api/v1/#tag/Apps
@@ -166,6 +182,10 @@ export declare const AppSchema: z.ZodObject<{
166
182
  iconMd: z.ZodNullable<z.ZodString>;
167
183
  iconLg: z.ZodNullable<z.ZodString>;
168
184
  appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
185
+ clientType: z.ZodEnum<{
186
+ public: "public";
187
+ confidential: "confidential";
188
+ }>;
169
189
  }, z.core.$strip>;
170
190
  /**
171
191
  * A developer application.
@@ -191,6 +211,10 @@ export declare const AppWithUserCountSchema: z.ZodObject<{
191
211
  iconMd: z.ZodNullable<z.ZodString>;
192
212
  iconLg: z.ZodNullable<z.ZodString>;
193
213
  appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
214
+ clientType: z.ZodEnum<{
215
+ public: "public";
216
+ confidential: "confidential";
217
+ }>;
194
218
  userCount: z.ZodNumber;
195
219
  }, z.core.$strip>;
196
220
  /**
@@ -344,6 +368,10 @@ export declare const InstalledIntegrationSchema: z.ZodObject<{
344
368
  iconMd: z.ZodNullable<z.ZodString>;
345
369
  iconLg: z.ZodNullable<z.ZodString>;
346
370
  appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
371
+ clientType: z.ZodEnum<{
372
+ public: "public";
373
+ confidential: "confidential";
374
+ }>;
347
375
  }, z.core.$strip>;
348
376
  /**
349
377
  * Embedded app info on an installation record.
@@ -376,6 +404,10 @@ export declare const AppInstallationSchema: z.ZodObject<{
376
404
  iconMd: z.ZodNullable<z.ZodString>;
377
405
  iconLg: z.ZodNullable<z.ZodString>;
378
406
  appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
407
+ clientType: z.ZodEnum<{
408
+ public: "public";
409
+ confidential: "confidential";
410
+ }>;
379
411
  }, z.core.$strip>>;
380
412
  }, z.core.$strip>;
381
413
  /**
@@ -1701,6 +1701,7 @@ export declare const validateApp: (input: unknown) => {
1701
1701
  iconMd: string | null;
1702
1702
  iconLg: string | null;
1703
1703
  appTokenScopes: string[] | null;
1704
+ clientType: "public" | "confidential";
1704
1705
  }, validateAppArray: (input: unknown) => {
1705
1706
  id: string;
1706
1707
  clientId: string;
@@ -1715,6 +1716,7 @@ export declare const validateApp: (input: unknown) => {
1715
1716
  iconMd: string | null;
1716
1717
  iconLg: string | null;
1717
1718
  appTokenScopes: string[] | null;
1719
+ clientType: "public" | "confidential";
1718
1720
  }[];
1719
1721
  export declare const validateAppWithUserCount: (input: unknown) => {
1720
1722
  id: string;
@@ -1730,6 +1732,7 @@ export declare const validateAppWithUserCount: (input: unknown) => {
1730
1732
  iconMd: string | null;
1731
1733
  iconLg: string | null;
1732
1734
  appTokenScopes: string[] | null;
1735
+ clientType: "public" | "confidential";
1733
1736
  userCount: number;
1734
1737
  };
1735
1738
  export declare const validateAppSecrets: (input: unknown) => {
@@ -1784,6 +1787,7 @@ export declare const validateAppInstallation: (input: unknown) => {
1784
1787
  iconMd: string | null;
1785
1788
  iconLg: string | null;
1786
1789
  appTokenScopes: string[] | null;
1790
+ clientType: "public" | "confidential";
1787
1791
  } | null;
1788
1792
  }, validateAppInstallationArray: (input: unknown) => {
1789
1793
  id: string;
@@ -1805,6 +1809,7 @@ export declare const validateAppInstallation: (input: unknown) => {
1805
1809
  iconMd: string | null;
1806
1810
  iconLg: string | null;
1807
1811
  appTokenScopes: string[] | null;
1812
+ clientType: "public" | "confidential";
1808
1813
  } | null;
1809
1814
  }[];
1810
1815
  export declare const validateUserAuthorization: (input: unknown) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todoist/sdk",
3
- "version": "18.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "The official TypeScript SDK for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "https://github.com/todoist/todoist-sdk-typescript",