@doist/todoist-sdk 9.1.0-next.2 → 9.1.1
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/authentication.js +1 -0
- package/dist/cjs/clients/app-client.js +347 -0
- package/dist/cjs/clients/base-client.js +1 -0
- package/dist/cjs/clients/ui-extension-client.js +109 -0
- package/dist/cjs/consts/endpoints.js +70 -6
- package/dist/cjs/test-utils/test-defaults.js +75 -23
- package/dist/cjs/todoist-api.js +269 -33
- package/dist/cjs/transport/http-client.js +1 -0
- package/dist/cjs/types/apps/types.js +253 -0
- package/dist/cjs/types/index.js +2 -1
- 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/response.js +10 -12
- package/dist/cjs/types/ui-extensions/index.js +18 -0
- package/dist/cjs/types/ui-extensions/types.js +77 -0
- package/dist/cjs/utils/validators.js +45 -33
- package/dist/esm/authentication.js +1 -0
- package/dist/esm/clients/app-client.js +343 -0
- package/dist/esm/clients/base-client.js +1 -0
- package/dist/esm/clients/ui-extension-client.js +105 -0
- package/dist/esm/consts/endpoints.js +54 -5
- package/dist/esm/test-utils/test-defaults.js +73 -22
- package/dist/esm/todoist-api.js +269 -33
- package/dist/esm/transport/http-client.js +1 -0
- package/dist/esm/types/apps/types.js +248 -0
- package/dist/esm/types/index.js +2 -1
- 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/response.js +0 -2
- package/dist/esm/types/ui-extensions/types.js +74 -0
- package/dist/esm/utils/validators.js +14 -2
- package/dist/types/authentication.d.ts +1 -1
- package/dist/types/clients/app-client.d.ts +37 -0
- package/dist/types/clients/base-client.d.ts +1 -0
- package/dist/types/clients/ui-extension-client.d.ts +18 -0
- package/dist/types/consts/endpoints.d.ts +25 -5
- package/dist/types/test-utils/test-defaults.d.ts +16 -4
- package/dist/types/todoist-api.d.ts +202 -12
- package/dist/types/types/apps/index.d.ts +2 -0
- package/dist/types/types/apps/requests.d.ts +89 -0
- package/dist/types/types/apps/types.d.ts +414 -0
- package/dist/types/types/http.d.ts +1 -1
- package/dist/types/types/index.d.ts +2 -1
- 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/user.d.ts +2 -2
- package/dist/types/types/sync/resources/view-options.d.ts +6 -6
- package/dist/types/types/sync/response.d.ts +6 -31
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/tasks/requests.d.ts +0 -1
- package/dist/types/types/ui-extensions/index.d.ts +2 -0
- package/dist/types/types/ui-extensions/requests.d.ts +108 -0
- package/dist/types/types/ui-extensions/types.d.ts +185 -0
- package/dist/types/utils/validators.d.ts +231 -55
- package/package.json +1 -1
- package/dist/cjs/clients/goals-client.js +0 -145
- package/dist/cjs/types/goals/types.js +0 -56
- package/dist/esm/clients/goals-client.js +0 -141
- package/dist/esm/types/goals/types.js +0 -53
- package/dist/types/clients/goals-client.d.ts +0 -20
- package/dist/types/types/goals/requests.d.ts +0 -33
- package/dist/types/types/goals/types.d.ts +0 -51
- package/dist/types/types/sync/commands/goals.d.ts +0 -33
- /package/dist/cjs/types/{goals → apps}/index.js +0 -0
- /package/dist/cjs/types/{goals → apps}/requests.js +0 -0
- /package/dist/cjs/types/{sync/commands/goals.js → ui-extensions/requests.js} +0 -0
- /package/dist/esm/types/{goals → apps}/index.js +0 -0
- /package/dist/esm/types/{goals → apps}/requests.js +0 -0
- /package/dist/{types/types/goals/index.d.ts → esm/types/ui-extensions/index.js} +0 -0
- /package/dist/esm/types/{sync/commands/goals.js → ui-extensions/requests.js} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_ACCESS_TOKEN_ID = exports.DEFAULT_DISTRIBUTION_TOKEN = exports.DEFAULT_UI_EXTENSION_ID = exports.DEFAULT_INSTALLATION_ID = exports.DEFAULT_APP_ID = exports.DEFAULT_COLLABORATOR_STATE = exports.DEFAULT_COLLABORATOR = exports.DEFAULT_FOLDER = exports.COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = exports.COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = exports.RAW_COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = exports.COMMENT_WITH_OPTIONALS_AS_NULL_TASK = exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK = exports.INVALID_COMMENT = exports.DEFAULT_LOCATION_REMINDER = exports.DEFAULT_ABSOLUTE_REMINDER = exports.DEFAULT_RELATIVE_REMINDER = exports.DEFAULT_REMINDER_ID = exports.DEFAULT_COMMENT = exports.DEFAULT_RAW_COMMENT = exports.INVALID_ATTACHMENT = exports.DEFAULT_ATTACHMENT = exports.INVALID_USER = exports.DEFAULT_USER = exports.INVALID_LABEL = exports.DEFAULT_LABEL = exports.INVALID_SECTION = exports.DEFAULT_SECTION = exports.DEFAULT_WORKSPACE_PROJECT = exports.PROJECT_WITH_OPTIONALS_AS_NULL = exports.INVALID_PROJECT = exports.DEFAULT_PROJECT = exports.TASK_WITH_OPTIONALS_AS_NULL = exports.INVALID_TASK = exports.DEFAULT_TASK = exports.DEFAULT_DEADLINE = exports.DEFAULT_DURATION = exports.DEFAULT_DUE_DATE = exports.INVALID_ENTITY_ID = exports.DEFAULT_REQUEST_ID = exports.DEFAULT_AUTH_TOKEN = exports.DEFAULT_PROJECT_VIEW_STYLE = exports.DEFAULT_PROJECT_NAME = exports.DEFAULT_PROJECT_ID = exports.DEFAULT_ORDER = exports.DEFAULT_TASK_PRIORITY = exports.DEFAULT_TASK_DESCRIPTION = exports.DEFAULT_TASK_CONTENT = exports.DEFAULT_TASK_ID = void 0;
|
|
4
|
+
exports.DEFAULT_NOTE = exports.DEFAULT_UI_EXTENSION = exports.DEFAULT_USER_AUTHORIZATION = exports.DEFAULT_APP_INSTALLATION = exports.DEFAULT_APP_WEBHOOK = exports.DEFAULT_APP_DISTRIBUTION_TOKEN = exports.DEFAULT_APP_TEST_TOKEN = exports.DEFAULT_APP_VERIFICATION_TOKEN = exports.DEFAULT_APP_SECRETS = exports.DEFAULT_APP_WITH_USER_COUNT = exports.DEFAULT_APP = void 0;
|
|
4
5
|
const url_helpers_1 = require("../utils/url-helpers");
|
|
5
6
|
exports.DEFAULT_TASK_ID = '1234';
|
|
6
7
|
exports.DEFAULT_TASK_CONTENT = 'This is a task';
|
|
@@ -280,30 +281,81 @@ exports.DEFAULT_COLLABORATOR_STATE = {
|
|
|
280
281
|
state: 'active',
|
|
281
282
|
isDeleted: false,
|
|
282
283
|
};
|
|
283
|
-
exports.
|
|
284
|
-
exports.
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
isCompleted: false,
|
|
294
|
-
completedAt: null,
|
|
295
|
-
responsibleUid: null,
|
|
296
|
-
isDeleted: false,
|
|
297
|
-
progress: {
|
|
298
|
-
totalTaskCount: 5,
|
|
299
|
-
completedTaskCount: 2,
|
|
300
|
-
percentage: 40,
|
|
301
|
-
},
|
|
302
|
-
creatorUid: DEFAULT_USER_ID,
|
|
284
|
+
exports.DEFAULT_APP_ID = '42';
|
|
285
|
+
exports.DEFAULT_INSTALLATION_ID = '1001';
|
|
286
|
+
exports.DEFAULT_UI_EXTENSION_ID = '2002';
|
|
287
|
+
exports.DEFAULT_DISTRIBUTION_TOKEN = 'dist-token-abc';
|
|
288
|
+
exports.DEFAULT_ACCESS_TOKEN_ID = '3003';
|
|
289
|
+
exports.DEFAULT_APP = {
|
|
290
|
+
id: exports.DEFAULT_APP_ID,
|
|
291
|
+
status: 'public',
|
|
292
|
+
displayName: 'Sample App',
|
|
293
|
+
userId: DEFAULT_USER_ID,
|
|
303
294
|
createdAt: defaultDate(),
|
|
304
|
-
|
|
295
|
+
serviceUrl: 'https://example.com',
|
|
296
|
+
oauthRedirectUri: 'https://example.com/callback',
|
|
297
|
+
description: 'A sample app',
|
|
298
|
+
iconSm: 'https://example.com/icon-sm.png',
|
|
299
|
+
iconMd: 'https://example.com/icon-md.png',
|
|
300
|
+
iconLg: 'https://example.com/icon-lg.png',
|
|
301
|
+
appTokenScopes: ['data:read', 'task:add'],
|
|
302
|
+
};
|
|
303
|
+
exports.DEFAULT_APP_WITH_USER_COUNT = Object.assign(Object.assign({}, exports.DEFAULT_APP), { userCount: 12 });
|
|
304
|
+
exports.DEFAULT_APP_SECRETS = {
|
|
305
|
+
clientId: 'client-id-xyz',
|
|
306
|
+
clientSecret: 'client-secret-xyz',
|
|
307
|
+
};
|
|
308
|
+
exports.DEFAULT_APP_VERIFICATION_TOKEN = {
|
|
309
|
+
verificationToken: 'verif-token-abc',
|
|
310
|
+
};
|
|
311
|
+
exports.DEFAULT_APP_TEST_TOKEN = {
|
|
312
|
+
accessToken: 'test-token-xyz',
|
|
313
|
+
};
|
|
314
|
+
exports.DEFAULT_APP_DISTRIBUTION_TOKEN = {
|
|
315
|
+
distributionToken: exports.DEFAULT_DISTRIBUTION_TOKEN,
|
|
316
|
+
};
|
|
317
|
+
exports.DEFAULT_APP_WEBHOOK = {
|
|
318
|
+
status: 'active',
|
|
319
|
+
callbackUrl: 'https://example.com/webhook',
|
|
320
|
+
version: '1',
|
|
321
|
+
events: ['item:added', 'item:completed'],
|
|
322
|
+
};
|
|
323
|
+
exports.DEFAULT_APP_INSTALLATION = {
|
|
324
|
+
id: exports.DEFAULT_INSTALLATION_ID,
|
|
325
|
+
creator: DEFAULT_USER_ID,
|
|
326
|
+
createdTs: 1700000000,
|
|
327
|
+
installationType: 'user',
|
|
328
|
+
appTokenScopesValidated: true,
|
|
329
|
+
integration: exports.DEFAULT_APP,
|
|
330
|
+
};
|
|
331
|
+
exports.DEFAULT_USER_AUTHORIZATION = {
|
|
332
|
+
accessTokenId: exports.DEFAULT_ACCESS_TOKEN_ID,
|
|
333
|
+
scope: ['data:read', 'task:add'],
|
|
334
|
+
scopeDescriptions: ['Read data', 'Add tasks'],
|
|
335
|
+
createdAt: new Date('2025-01-01T00:00:00Z'),
|
|
336
|
+
app: {
|
|
337
|
+
id: exports.DEFAULT_APP_ID,
|
|
338
|
+
displayName: 'Sample App',
|
|
339
|
+
description: 'A sample app',
|
|
340
|
+
serviceUrl: 'https://example.com',
|
|
341
|
+
iconMd: 'https://example.com/icon-md.png',
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
exports.DEFAULT_UI_EXTENSION = {
|
|
345
|
+
id: exports.DEFAULT_UI_EXTENSION_ID,
|
|
346
|
+
integrationId: exports.DEFAULT_APP_ID,
|
|
347
|
+
extensionId: 'ext-guid-1',
|
|
348
|
+
extensionType: 'context-menu',
|
|
349
|
+
contextType: 'task',
|
|
350
|
+
url: 'https://example.com/extension',
|
|
351
|
+
icon: 'https://example.com/icon.png',
|
|
352
|
+
name: 'My Extension',
|
|
353
|
+
description: 'Does things in the task context menu',
|
|
354
|
+
width: 400,
|
|
355
|
+
height: 600,
|
|
356
|
+
defVersion: 2,
|
|
357
|
+
minimumCardistVersion: '0.60',
|
|
305
358
|
};
|
|
306
|
-
exports.DEFAULT_GOAL_NO_PROGRESS = Object.assign(Object.assign({}, exports.DEFAULT_GOAL), { id: 'e5f6g7h8-e29b-41d4-a716-446655440001', progress: undefined });
|
|
307
359
|
exports.DEFAULT_NOTE = {
|
|
308
360
|
id: DEFAULT_COMMENT_ID,
|
|
309
361
|
projectId: exports.DEFAULT_PROJECT_ID,
|
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TodoistApi = void 0;
|
|
4
4
|
const activity_client_1 = require("./clients/activity-client");
|
|
5
|
+
const app_client_1 = require("./clients/app-client");
|
|
5
6
|
const backup_client_1 = require("./clients/backup-client");
|
|
6
7
|
const comment_client_1 = require("./clients/comment-client");
|
|
7
8
|
const email_client_1 = require("./clients/email-client");
|
|
8
9
|
const folder_client_1 = require("./clients/folder-client");
|
|
9
|
-
const goals_client_1 = require("./clients/goals-client");
|
|
10
10
|
const id_mapping_client_1 = require("./clients/id-mapping-client");
|
|
11
11
|
const insights_client_1 = require("./clients/insights-client");
|
|
12
12
|
const label_client_1 = require("./clients/label-client");
|
|
@@ -16,6 +16,7 @@ const reminder_client_1 = require("./clients/reminder-client");
|
|
|
16
16
|
const section_client_1 = require("./clients/section-client");
|
|
17
17
|
const task_client_1 = require("./clients/task-client");
|
|
18
18
|
const template_client_1 = require("./clients/template-client");
|
|
19
|
+
const ui_extension_client_1 = require("./clients/ui-extension-client");
|
|
19
20
|
const upload_client_1 = require("./clients/upload-client");
|
|
20
21
|
const workspace_client_1 = require("./clients/workspace-client");
|
|
21
22
|
const endpoints_1 = require("./consts/endpoints");
|
|
@@ -60,7 +61,8 @@ class TodoistApi {
|
|
|
60
61
|
this.activityClient = new activity_client_1.ActivityClient(clientDeps);
|
|
61
62
|
this.productivityClient = new productivity_client_1.ProductivityClient(clientDeps);
|
|
62
63
|
this.workspaceClient = new workspace_client_1.WorkspaceClient(clientDeps);
|
|
63
|
-
this.
|
|
64
|
+
this.appClient = new app_client_1.AppClient(clientDeps);
|
|
65
|
+
this.uiExtensionClient = new ui_extension_client_1.UiExtensionClient(clientDeps);
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* Executes a raw Sync API request.
|
|
@@ -940,37 +942,6 @@ class TodoistApi {
|
|
|
940
942
|
async deleteFolder(id, requestId) {
|
|
941
943
|
return this.folderClient.deleteFolder(id, requestId);
|
|
942
944
|
}
|
|
943
|
-
// ── Goals ──
|
|
944
|
-
async getGoals(args) {
|
|
945
|
-
return this.goalsClient.getGoals(args);
|
|
946
|
-
}
|
|
947
|
-
async searchGoals(args) {
|
|
948
|
-
return this.goalsClient.searchGoals(args);
|
|
949
|
-
}
|
|
950
|
-
async getGoal(id) {
|
|
951
|
-
return this.goalsClient.getGoal(id);
|
|
952
|
-
}
|
|
953
|
-
async addGoal(args, requestId) {
|
|
954
|
-
return this.goalsClient.addGoal(args, requestId);
|
|
955
|
-
}
|
|
956
|
-
async updateGoal(id, args, requestId) {
|
|
957
|
-
return this.goalsClient.updateGoal(id, args, requestId);
|
|
958
|
-
}
|
|
959
|
-
async deleteGoal(id, requestId) {
|
|
960
|
-
return this.goalsClient.deleteGoal(id, requestId);
|
|
961
|
-
}
|
|
962
|
-
async completeGoal(id, requestId) {
|
|
963
|
-
return this.goalsClient.completeGoal(id, requestId);
|
|
964
|
-
}
|
|
965
|
-
async uncompleteGoal(id, requestId) {
|
|
966
|
-
return this.goalsClient.uncompleteGoal(id, requestId);
|
|
967
|
-
}
|
|
968
|
-
async linkTaskToGoal(args, requestId) {
|
|
969
|
-
return this.goalsClient.linkTaskToGoal(args, requestId);
|
|
970
|
-
}
|
|
971
|
-
async unlinkTaskFromGoal(args, requestId) {
|
|
972
|
-
return this.goalsClient.unlinkTaskFromGoal(args, requestId);
|
|
973
|
-
}
|
|
974
945
|
// ── Backups ──
|
|
975
946
|
/**
|
|
976
947
|
* Retrieves a list of available backups.
|
|
@@ -1297,5 +1268,270 @@ class TodoistApi {
|
|
|
1297
1268
|
async getWorkspaceArchivedProjects(args, requestId) {
|
|
1298
1269
|
return this.workspaceClient.getWorkspaceArchivedProjects(args, requestId);
|
|
1299
1270
|
}
|
|
1271
|
+
// ---------------------------------------------------------------------------
|
|
1272
|
+
// App management (dev:app_console scope)
|
|
1273
|
+
// ---------------------------------------------------------------------------
|
|
1274
|
+
/**
|
|
1275
|
+
* Lists all developer applications owned by the authenticated user.
|
|
1276
|
+
*
|
|
1277
|
+
* Requires the `dev:app_console` scope.
|
|
1278
|
+
*
|
|
1279
|
+
* @param requestId - Optional request ID for idempotency.
|
|
1280
|
+
* @returns A promise that resolves to the list of apps.
|
|
1281
|
+
*/
|
|
1282
|
+
async getApps(requestId) {
|
|
1283
|
+
return this.appClient.getApps(requestId);
|
|
1284
|
+
}
|
|
1285
|
+
/**
|
|
1286
|
+
* Retrieves a single developer application by ID.
|
|
1287
|
+
*
|
|
1288
|
+
* Requires the `dev:app_console` scope.
|
|
1289
|
+
*/
|
|
1290
|
+
async getApp(appId, requestId) {
|
|
1291
|
+
return this.appClient.getApp(appId, requestId);
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Creates a new developer application.
|
|
1295
|
+
*
|
|
1296
|
+
* Requires the `dev:app_console` scope.
|
|
1297
|
+
*/
|
|
1298
|
+
async addApp(args, requestId) {
|
|
1299
|
+
return this.appClient.addApp(args, requestId);
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Updates a developer application.
|
|
1303
|
+
*
|
|
1304
|
+
* Requires the `dev:app_console` scope.
|
|
1305
|
+
*/
|
|
1306
|
+
async updateApp(appId, args, requestId) {
|
|
1307
|
+
return this.appClient.updateApp(appId, args, requestId);
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Deletes a developer application.
|
|
1311
|
+
*
|
|
1312
|
+
* Requires the `dev:app_console` scope.
|
|
1313
|
+
*/
|
|
1314
|
+
async deleteApp(appId, requestId) {
|
|
1315
|
+
return this.appClient.deleteApp(appId, requestId);
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Retrieves the OAuth client credentials (client ID and secret) for an app.
|
|
1319
|
+
*
|
|
1320
|
+
* Requires the `dev:app_console` scope.
|
|
1321
|
+
*/
|
|
1322
|
+
async getAppSecrets(appId, requestId) {
|
|
1323
|
+
return this.appClient.getAppSecrets(appId, requestId);
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Rotates the app's OAuth client secret, returning the updated app record.
|
|
1327
|
+
*
|
|
1328
|
+
* Requires the `dev:app_console` scope.
|
|
1329
|
+
*/
|
|
1330
|
+
async resetAppClientSecret(appId, requestId) {
|
|
1331
|
+
return this.appClient.resetAppClientSecret(appId, requestId);
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* Revokes every access token issued for the given app.
|
|
1335
|
+
*
|
|
1336
|
+
* Requires the `dev:app_console` scope.
|
|
1337
|
+
*/
|
|
1338
|
+
async revokeAppTokens(appId, requestId) {
|
|
1339
|
+
return this.appClient.revokeAppTokens(appId, requestId);
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Uploads an icon for a developer application. The `size` argument
|
|
1343
|
+
* selects which icon slot to update (defaults to `'medium'`).
|
|
1344
|
+
*
|
|
1345
|
+
* Requires the `dev:app_console` scope.
|
|
1346
|
+
*/
|
|
1347
|
+
async uploadAppIcon(args, requestId) {
|
|
1348
|
+
return this.appClient.uploadAppIcon(args, requestId);
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* Gets the currently issued developer test token for an app (null if none exists).
|
|
1352
|
+
*
|
|
1353
|
+
* Requires the `dev:app_console` scope.
|
|
1354
|
+
*/
|
|
1355
|
+
async getAppTestToken(appId, requestId) {
|
|
1356
|
+
return this.appClient.getAppTestToken(appId, requestId);
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Creates (or rotates) a developer test token for an app.
|
|
1360
|
+
*
|
|
1361
|
+
* Requires the `dev:app_console` scope.
|
|
1362
|
+
*/
|
|
1363
|
+
async createAppTestToken(appId, requestId) {
|
|
1364
|
+
return this.appClient.createAppTestToken(appId, requestId);
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Gets the distribution token for an app, which third parties use to install it.
|
|
1368
|
+
*
|
|
1369
|
+
* Requires the `dev:app_console` scope.
|
|
1370
|
+
*/
|
|
1371
|
+
async getAppDistributionToken(appId, requestId) {
|
|
1372
|
+
return this.appClient.getAppDistributionToken(appId, requestId);
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Gets the current webhook verification token for an app.
|
|
1376
|
+
*
|
|
1377
|
+
* Requires the `dev:app_console` scope.
|
|
1378
|
+
*/
|
|
1379
|
+
async getAppVerificationToken(appId, requestId) {
|
|
1380
|
+
return this.appClient.getAppVerificationToken(appId, requestId);
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* Resets the webhook verification token for an app, returning the new value.
|
|
1384
|
+
*
|
|
1385
|
+
* Requires the `dev:app_console` scope.
|
|
1386
|
+
*/
|
|
1387
|
+
async resetAppVerificationToken(appId, requestId) {
|
|
1388
|
+
return this.appClient.resetAppVerificationToken(appId, requestId);
|
|
1389
|
+
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Resolves a public-facing app view from a distribution token. Used during
|
|
1392
|
+
* the installation flow to show prospective installers what the app does
|
|
1393
|
+
* and which scopes it requests.
|
|
1394
|
+
*
|
|
1395
|
+
* Requires the `dev:app_console` scope.
|
|
1396
|
+
*/
|
|
1397
|
+
async getAppByDistributionToken(distributionToken, requestId) {
|
|
1398
|
+
return this.appClient.getAppByDistributionToken(distributionToken, requestId);
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Gets the webhook configuration for an app (null if no webhook is configured).
|
|
1402
|
+
*
|
|
1403
|
+
* Requires the `dev:app_console` scope.
|
|
1404
|
+
*/
|
|
1405
|
+
async getAppWebhook(appId, requestId) {
|
|
1406
|
+
return this.appClient.getAppWebhook(appId, requestId);
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Creates or updates an app webhook configuration (upsert).
|
|
1410
|
+
*
|
|
1411
|
+
* Requires the `dev:app_console` scope.
|
|
1412
|
+
*/
|
|
1413
|
+
async updateAppWebhook(args, requestId) {
|
|
1414
|
+
return this.appClient.updateAppWebhook(args, requestId);
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* Deletes an app webhook configuration.
|
|
1418
|
+
*
|
|
1419
|
+
* Requires the `dev:app_console` scope.
|
|
1420
|
+
*/
|
|
1421
|
+
async deleteAppWebhook(appId, requestId) {
|
|
1422
|
+
return this.appClient.deleteAppWebhook(appId, requestId);
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Lists all apps installed on the authenticated user's account.
|
|
1426
|
+
*
|
|
1427
|
+
* Requires the `dev:app_console` scope.
|
|
1428
|
+
*/
|
|
1429
|
+
async getAppInstallations(requestId) {
|
|
1430
|
+
return this.appClient.getAppInstallations(requestId);
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Installs an application via its distribution token.
|
|
1434
|
+
*
|
|
1435
|
+
* Requires the `dev:app_console` scope.
|
|
1436
|
+
*/
|
|
1437
|
+
async installApp(args, requestId) {
|
|
1438
|
+
return this.appClient.installApp(args, requestId);
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Retrieves a single app installation by ID.
|
|
1442
|
+
*
|
|
1443
|
+
* Requires the `dev:app_console` scope.
|
|
1444
|
+
*/
|
|
1445
|
+
async getAppInstallation(installationId, requestId) {
|
|
1446
|
+
return this.appClient.getAppInstallation(installationId, requestId);
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* Updates an app installation.
|
|
1450
|
+
*
|
|
1451
|
+
* Requires the `dev:app_console` scope.
|
|
1452
|
+
*/
|
|
1453
|
+
async updateAppInstallation(installationId, args, requestId) {
|
|
1454
|
+
return this.appClient.updateAppInstallation(installationId, args, requestId);
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Uninstalls (removes) an app installation.
|
|
1458
|
+
*
|
|
1459
|
+
* Requires the `dev:app_console` scope.
|
|
1460
|
+
*/
|
|
1461
|
+
async uninstallApp(installationId, requestId) {
|
|
1462
|
+
return this.appClient.uninstallApp(installationId, requestId);
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Retrieves a single UI extension by ID.
|
|
1466
|
+
*
|
|
1467
|
+
* Requires the `dev:app_console` scope.
|
|
1468
|
+
*/
|
|
1469
|
+
async getUiExtension(uiExtensionId, requestId) {
|
|
1470
|
+
return this.uiExtensionClient.getUiExtension(uiExtensionId, requestId);
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Lists UI extensions available (installed) in the web client for the current user.
|
|
1474
|
+
*
|
|
1475
|
+
* Requires the `dev:app_console` scope.
|
|
1476
|
+
*/
|
|
1477
|
+
async getInstalledUiExtensions(requestId) {
|
|
1478
|
+
return this.uiExtensionClient.getInstalledUiExtensions(requestId);
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Lists all UI extensions belonging to a given app (integration).
|
|
1482
|
+
*
|
|
1483
|
+
* Requires the `dev:app_console` scope.
|
|
1484
|
+
*/
|
|
1485
|
+
async getUiExtensionsForApp(appId, requestId) {
|
|
1486
|
+
return this.uiExtensionClient.getUiExtensionsForApp(appId, requestId);
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Adds a new UI extension to an app.
|
|
1490
|
+
*
|
|
1491
|
+
* Requires the `dev:app_console` scope.
|
|
1492
|
+
*/
|
|
1493
|
+
async addUiExtension(args, requestId) {
|
|
1494
|
+
return this.uiExtensionClient.addUiExtension(args, requestId);
|
|
1495
|
+
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Updates an existing UI extension.
|
|
1498
|
+
*
|
|
1499
|
+
* Requires the `dev:app_console` scope.
|
|
1500
|
+
*/
|
|
1501
|
+
async updateUiExtension(uiExtensionId, args, requestId) {
|
|
1502
|
+
return this.uiExtensionClient.updateUiExtension(uiExtensionId, args, requestId);
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Deletes a UI extension.
|
|
1506
|
+
*
|
|
1507
|
+
* Requires the `dev:app_console` scope.
|
|
1508
|
+
*/
|
|
1509
|
+
async deleteUiExtension(uiExtensionId, requestId) {
|
|
1510
|
+
return this.uiExtensionClient.deleteUiExtension(uiExtensionId, requestId);
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Uploads an icon for a UI extension.
|
|
1514
|
+
*
|
|
1515
|
+
* Requires the `dev:app_console` scope.
|
|
1516
|
+
*/
|
|
1517
|
+
async uploadUiExtensionIcon(args, requestId) {
|
|
1518
|
+
return this.uiExtensionClient.uploadUiExtensionIcon(args, requestId);
|
|
1519
|
+
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Lists all apps the user has authorized (granted a token to).
|
|
1522
|
+
*
|
|
1523
|
+
* Requires the `dev:app_console` scope.
|
|
1524
|
+
*/
|
|
1525
|
+
async getUserAuthorizations(requestId) {
|
|
1526
|
+
return this.appClient.getUserAuthorizations(requestId);
|
|
1527
|
+
}
|
|
1528
|
+
/**
|
|
1529
|
+
* Revokes a specific user authorization (access token granted to a third-party app).
|
|
1530
|
+
*
|
|
1531
|
+
* Requires the `dev:app_console` scope.
|
|
1532
|
+
*/
|
|
1533
|
+
async revokeUserAuthorization(args, requestId) {
|
|
1534
|
+
return this.appClient.revokeUserAuthorization(args, requestId);
|
|
1535
|
+
}
|
|
1300
1536
|
}
|
|
1301
1537
|
exports.TodoistApi = TodoistApi;
|
|
@@ -100,6 +100,7 @@ async function request(args) {
|
|
|
100
100
|
break;
|
|
101
101
|
case 'POST':
|
|
102
102
|
case 'PUT':
|
|
103
|
+
case 'PATCH':
|
|
103
104
|
case 'DELETE': {
|
|
104
105
|
// Convert payload from camelCase to snake_case
|
|
105
106
|
// Note: While DELETE with body is uncommon, the Todoist API uses it for some endpoints
|