Skip to content

Commit c3ecbb1

Browse files
committed
prepare mock connector - todoist
1 parent fe05fdc commit c3ecbb1

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

src/appmixer/todoist/artifacts/ai-artifacts/commands-log

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,7 @@ appmixer test component src/appmixer/todoist/core/CreateTask/ -i '{"in":{"conten
152152
appmixer test component src/appmixer/todoist/core/CreateReminder/ -i '{"in":{"taskId":"9916526119","type":"relative","minuteOffset":30}}'
153153
appmixer test component src/appmixer/todoist/core/CreateTask/ -i '{"in":{"content":"Test Task with Due Date for Reminder","dueString":"tomorrow at 10am"}}'
154154
appmixer test component src/appmixer/todoist/core/CreateReminder/ -i '{"in":{"taskId":"9916527204","type":"relative","minuteOffset":30}}'
155+
appmixer test component src/appmixer/todoist/core/CreateComment/ -i '{"in":{"content":"This is a test comment for validation","taskId":"9907454175"}}'
156+
appmixer test component src/appmixer/todoist/core/CreateComment/ -i '{"in":{"content":"Another test comment for validation","taskId":"9907454175"}}'
157+
appmixer test component src/appmixer/todoist/core/CreateProject/ -i '{"in":{"name":"E2E Test Project"}}'
158+
appmixer test component src/appmixer/todoist/core/GetProject/ -i '{"in":{"projectId":"2365437921"}}'

src/appmixer/todoist/artifacts/ai-artifacts/test-plan.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@
9292
"stderr": "",
9393
"duration": 1493,
9494
"command": "appmixer test component src/appmixer/todoist/core/CreateProject/ -i '{\"in\":{\"name\":\"E2E Test Project Validation\",\"color\":\"orange\",\"isFavorite\":true}}'"
95+
},
96+
{
97+
"exitCode": 0,
98+
"cmd": "appmixer test component /Users/vladimir/Projects/appmixer-connectors/src/appmixer/todoist/core/CreateProject -i {\"in\":{\"name\":\"E2E Test Project\"}}",
99+
"stdout": "Component has send a message to output port: out\n{\n id: '2366245605',\n parent_id: null,\n order: 7,\n color: 'charcoal',\n name: 'E2E Test Project',\n is_shared: false,\n is_favorite: false,\n is_inbox_project: false,\n is_team_inbox: false,\n url: 'https://app.todoist.com/app/project/6frC9HxhXQJPm7Qh',\n view_style: 'list',\n description: '',\n comment_count: 0\n}\n\n\n\nComponent's receive method finished in: 717 ms.\n\nComponent's state at the end:\nState is empty, component did not store anything into state.\n\nStopping component.",
100+
"stderr": "",
101+
"duration": 1505,
102+
"command": "appmixer test component src/appmixer/todoist/core/CreateProject/ -i '{\"in\":{\"name\":\"E2E Test Project\"}}'"
95103
}
96104
]
97105
},
@@ -280,6 +288,22 @@
280288
"stderr": "",
281289
"duration": 1116,
282290
"command": "appmixer test component src/appmixer/todoist/core/CreateComment/ -i '{\"in\":{\"content\":\"This is a test comment on a project\",\"projectId\":\"2365436060\"}}'"
291+
},
292+
{
293+
"exitCode": 1,
294+
"cmd": "appmixer test component /Users/vladimir/Projects/appmixer-connectors/src/appmixer/todoist/core/CreateComment -i {\"in\":{\"content\":\"This is a test comment for validation\",\"taskId\":\"9907454175\"}}",
295+
"stdout": "\nTesting /Users/vladimir/Projects/appmixer-connectors/src/appmixer/todoist/core/CreateComment\nhttps://api.appmixer.com\n\nValidating properties.\n{ path: '/Users/vladimir/.config/configstore/appmixer.json' }\nprogram.url undefined\nUsing client ID (from local storage): 30d04a08e7434f8b8f3a454c806b4489\nUsing client secret (from local storage): df827dbc1ec8405ab292a3cbf0823f21\nUsing access token (from local storage): 34ac806ec2c61ced6d1d4caf5c3b02ef7ca0531a\n\nCreating authentication module.\n\nSetting access token.\n\nTest server is listening on 2300\n\nStarting component.\n\nCalling receive method with input message:\n\u001b[32min: \u001b[39m\n \u001b[32m- \u001b[39m\n \u001b[32mproperties: \u001b[39m\n \u001b[32mcorrelationId: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mgridInstanceId: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mcontentType: \u001b[39m application/json\n \u001b[32mcontentEncoding: \u001b[39m utf8\n \u001b[32msender: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mdestination: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mcorrelationInPort: \u001b[39m\u001b[90mnull\u001b[39m\n \u001b[32mcomponentHeaders: \u001b[39m\n \u001b[32msignal: \u001b[39m \u001b[31mfalse\u001b[39m\n \u001b[32mflowId: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mcontent: \u001b[39m\n \u001b[32mcontent: \u001b[39mThis is a test comment for validation\n \u001b[32mtaskId: \u001b[39m 9907454175\n \u001b[32mscope: \u001b[39m\n\n[ERROR]: Request failed with status code 404\nProject not found\n",
296+
"stderr": "",
297+
"duration": 1152,
298+
"command": "appmixer test component src/appmixer/todoist/core/CreateComment/ -i '{\"in\":{\"content\":\"This is a test comment for validation\",\"taskId\":\"9907454175\"}}'"
299+
},
300+
{
301+
"exitCode": 1,
302+
"cmd": "appmixer test component /Users/vladimir/Projects/appmixer-connectors/src/appmixer/todoist/core/CreateComment -i {\"in\":{\"content\":\"Another test comment for validation\",\"taskId\":\"9907454175\"}}",
303+
"stdout": "\nTesting /Users/vladimir/Projects/appmixer-connectors/src/appmixer/todoist/core/CreateComment\nhttps://api.appmixer.com\n\nValidating properties.\n{ path: '/Users/vladimir/.config/configstore/appmixer.json' }\nprogram.url undefined\nUsing client ID (from local storage): 30d04a08e7434f8b8f3a454c806b4489\nUsing client secret (from local storage): df827dbc1ec8405ab292a3cbf0823f21\nUsing access token (from local storage): 34ac806ec2c61ced6d1d4caf5c3b02ef7ca0531a\n\nCreating authentication module.\n\nSetting access token.\n\nTest server is listening on 2300\n\nStarting component.\n\nCalling receive method with input message:\n\u001b[32min: \u001b[39m\n \u001b[32m- \u001b[39m\n \u001b[32mproperties: \u001b[39m\n \u001b[32mcorrelationId: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mgridInstanceId: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mcontentType: \u001b[39m application/json\n \u001b[32mcontentEncoding: \u001b[39m utf8\n \u001b[32msender: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mdestination: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mcorrelationInPort: \u001b[39m\u001b[90mnull\u001b[39m\n \u001b[32mcomponentHeaders: \u001b[39m\n \u001b[32msignal: \u001b[39m \u001b[31mfalse\u001b[39m\n \u001b[32mflowId: \u001b[39m \u001b[90mnull\u001b[39m\n \u001b[32mcontent: \u001b[39m\n \u001b[32mcontent: \u001b[39mAnother test comment for validation\n \u001b[32mtaskId: \u001b[39m 9907454175\n \u001b[32mscope: \u001b[39m\n\n[ERROR]: Request failed with status code 404\nProject not found\n",
304+
"stderr": "",
305+
"duration": 1058,
306+
"command": "appmixer test component src/appmixer/todoist/core/CreateComment/ -i '{\"in\":{\"content\":\"Another test comment for validation\",\"taskId\":\"9907454175\"}}'"
283307
}
284308
]
285309
},
@@ -715,6 +739,14 @@
715739
"stderr": "",
716740
"duration": 1404,
717741
"command": "appmixer test component src/appmixer/todoist/core/GetProject/ -i '{\"in\":{\"projectId\":\"2365437940\"}}'"
742+
},
743+
{
744+
"exitCode": 0,
745+
"cmd": "appmixer test component /Users/vladimir/Projects/appmixer-connectors/src/appmixer/todoist/core/GetProject -i {\"in\":{\"projectId\":\"2365437921\"}}",
746+
"stdout": "Component has send a message to output port: out\n{\n id: '2365437921',\n parent_id: null,\n order: 1,\n color: 'blue',\n name: 'E2E Test Project',\n is_shared: false,\n is_favorite: true,\n is_inbox_project: false,\n is_team_inbox: false,\n url: 'https://app.todoist.com/app/project/6fjhFGrHMwMQPCRh',\n view_style: 'list',\n description: '',\n comment_count: 7\n}\n\n\n\nComponent's receive method finished in: 390 ms.\n\nComponent's state at the end:\nState is empty, component did not store anything into state.\n\nStopping component.",
747+
"stderr": "",
748+
"duration": 1193,
749+
"command": "appmixer test component src/appmixer/todoist/core/GetProject/ -i '{\"in\":{\"projectId\":\"2365437921\"}}'"
718750
}
719751
]
720752
},

src/appmixer/todoist/core/GetProject/GetProject.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = {
1414

1515
const project = await lib.apiRequest(context, `/projects/${projectId}`);
1616

17+
18+
console.log(JSON.stringify(project));
1719
return context.sendJson(project, 'out');
1820
}
1921
};

src/appmixer/todoist/core/ListProjects/ListProjects.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ module.exports = {
3232

3333
const projects = await lib.apiRequest(context, '/projects');
3434

35+
console.log( JSON.stringify(projects));
36+
3537
return lib.sendArrayOutput({
3638
context,
3739
outputType: outputType || 'array',

0 commit comments

Comments
 (0)