feat(todoist): add app, authentication, docs (#826)

This commit is contained in:
Ian Levesque
2023-01-07 09:09:39 -05:00
committed by GitHub
parent ff0bde059a
commit 1a4a1f7f8b
19 changed files with 418 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import listProjects from './list-projects';
import listSections from './list-sections';
import listLabels from './list-labels';
export default [listProjects, listSections, listLabels];

View File

@@ -0,0 +1,19 @@
import { IGlobalVariable } from '@automatisch/types';
export default {
name: 'List labels',
key: 'listLabels',
async run($: IGlobalVariable) {
const response = await $.http.get('/labels');
response.data = response.data.map((label: { name: string }) => {
return {
value: label.name,
name: label.name,
};
});
return response;
},
};

View File

@@ -0,0 +1,19 @@
import { IGlobalVariable } from '@automatisch/types';
export default {
name: 'List projects',
key: 'listProjects',
async run($: IGlobalVariable) {
const response = await $.http.get('/projects');
response.data = response.data.map((project: { id: string, name: string }) => {
return {
value: project.id,
name: project.name,
};
});
return response;
},
};

View File

@@ -0,0 +1,23 @@
import { IGlobalVariable } from '@automatisch/types';
export default {
name: 'List sections',
key: 'listSections',
async run($: IGlobalVariable) {
const params = {
project_id: ($.step.parameters.projectId as string),
};
const response = await $.http.get('/sections', {params});
response.data = response.data.map((section: { id: string, name: string }) => {
return {
value: section.id,
name: section.name,
};
});
return response;
},
};