@cyberismo/backend 0.0.3

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.
@@ -0,0 +1,675 @@
1
+ /**
2
+ Cyberismo
3
+ Copyright © Cyberismo Ltd and contributors 2024
4
+
5
+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
6
+
7
+ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
8
+
9
+ You should have received a copy of the GNU Affero General Public
10
+ License along with this program. If not, see <https://www.gnu.org/licenses/>.
11
+ */
12
+ import { Hono } from 'hono';
13
+ import Processor from '@asciidoctor/core';
14
+ import { CardLocation, } from '@cyberismo/data-handler/interfaces/project-interfaces';
15
+ import { evaluateMacros } from '@cyberismo/data-handler';
16
+ const router = new Hono();
17
+ /**
18
+ * @swagger
19
+ * /api/cards:
20
+ * get:
21
+ * summary: Returns a list of all cards and their children in the defined project.
22
+ * description: List of cards does not include the content of the cards, only basic metadata. Use the /api/cards/{key} endpoint to get the content of a specific card.
23
+ * responses:
24
+ * 200:
25
+ * description: Object containing the project cards. See definitions.ts/Card for the structure.
26
+ * 400:
27
+ * description: Error in reading project details.
28
+ * 500:
29
+ * description: project_path not set.
30
+ */
31
+ router.get('/', async (c) => {
32
+ const commands = c.get('commands');
33
+ const projectResponse = await commands.showCmd.showProject();
34
+ const workflowsResponse = await commands.showCmd.showWorkflowsWithDetails();
35
+ if (!workflowsResponse) {
36
+ return c.text(`No workflows found from path ${c.get('projectPath')}`, 500);
37
+ }
38
+ const cardTypesResponse = await commands.showCmd.showCardTypesWithDetails();
39
+ if (!cardTypesResponse) {
40
+ return c.text(`No card types found from path ${c.get('projectPath')}`, 500);
41
+ }
42
+ const cardsResponse = await commands.showCmd.showProjectCards();
43
+ if (!cardsResponse) {
44
+ return c.text(`No cards found from path ${c.get('projectPath')}`, 500);
45
+ }
46
+ const response = {
47
+ name: projectResponse.name,
48
+ cards: cardsResponse,
49
+ workflows: workflowsResponse,
50
+ cardTypes: cardTypesResponse,
51
+ };
52
+ return c.json(response);
53
+ });
54
+ async function getCardDetails(commands, key) {
55
+ const fetchCardDetails = {
56
+ attachments: true,
57
+ children: false,
58
+ content: true,
59
+ contentType: 'adoc',
60
+ metadata: false,
61
+ parent: false,
62
+ location: CardLocation.projectOnly,
63
+ };
64
+ let cardDetailsResponse;
65
+ try {
66
+ cardDetailsResponse = await commands.showCmd.showCardDetails(fetchCardDetails, key);
67
+ }
68
+ catch {
69
+ return { status: 400, message: `Card ${key} not found from project` };
70
+ }
71
+ if (!cardDetailsResponse) {
72
+ return { status: 400, message: `Card ${key} not found from project` };
73
+ }
74
+ let asciidocContent = '';
75
+ try {
76
+ asciidocContent = await evaluateMacros(cardDetailsResponse.content || '', {
77
+ mode: 'inject',
78
+ projectPath: commands.project.basePath || '',
79
+ cardKey: key,
80
+ });
81
+ }
82
+ catch (error) {
83
+ asciidocContent = `Macro error: ${error instanceof Error ? error.message : 'Unknown error'}\n\n${asciidocContent}`;
84
+ }
85
+ const htmlContent = Processor()
86
+ .convert(asciidocContent, {
87
+ safe: 'safe',
88
+ attributes: {
89
+ imagesdir: `/api/cards/${key}/a`,
90
+ icons: 'font',
91
+ },
92
+ })
93
+ .toString();
94
+ // always parse for now
95
+ await commands.calculateCmd.generate();
96
+ const card = await commands.calculateCmd.runQuery('card', {
97
+ cardKey: key,
98
+ });
99
+ if (card.length !== 1) {
100
+ throw new Error('Query failed. Check card-query syntax');
101
+ }
102
+ return {
103
+ status: 200,
104
+ data: {
105
+ ...card[0],
106
+ rawContent: cardDetailsResponse.content || '',
107
+ parsedContent: htmlContent,
108
+ attachments: cardDetailsResponse.attachments,
109
+ },
110
+ };
111
+ }
112
+ /**
113
+ * @swagger
114
+ * /api/cards/{key}:
115
+ * get:
116
+ * summary: Returns the full content of a specific card including calculations.
117
+ * description: The key parameter is the unique identifier ("cardKey") of the card. The response includes the content as asciidoc(editable) and parsed html, which also has macros already injected
118
+ * parameters:
119
+ * - name: key
120
+ * in: path
121
+ * required: true
122
+ * description: Card key (string)
123
+ * responses:
124
+ * 200:
125
+ * description: Object containing card details. See lib/api/types.ts/CardResponse for the structure.
126
+ * 400:
127
+ * description: No search key or card not found with given key
128
+ * 500:
129
+ * description: project_path not set.
130
+ */
131
+ router.get('/:key', async (c) => {
132
+ const key = c.req.param('key');
133
+ if (!key) {
134
+ return c.text('No search key', 400);
135
+ }
136
+ const result = await getCardDetails(c.get('commands'), key);
137
+ if (result.status === 200) {
138
+ return c.json(result.data);
139
+ }
140
+ else {
141
+ return c.text(result.message || 'Unknown error', result.status);
142
+ }
143
+ });
144
+ /**
145
+ * @swagger
146
+ * /api/cards/{key}:
147
+ * patch:
148
+ * summary: Make changes to a card
149
+ * description: The key parameter is the unique identifier ("cardKey") of the card.
150
+ * parameters:
151
+ * - name: key
152
+ * in: path
153
+ * required: true
154
+ * description: Card key (string)
155
+ * - name: content
156
+ * in: body
157
+ * required: false
158
+ * description: New asciidoc content for the card. Must be a string.
159
+ * - name: metadata
160
+ * in: body
161
+ * type: object
162
+ * required: false
163
+ * description: New metadata for the card. Must be an object with key-value pairs.
164
+ * responses:
165
+ * 200:
166
+ * description: Object containing card details, same as GET. See definitions.ts/CardDetails for the structure.
167
+ * 207:
168
+ * description: Partial success. some updates failed, some succeeded. Returns card object with successful updates.
169
+ * 400:
170
+ * description: Error. Card not found, all updates failed etc. Error message in response body.
171
+ * 500:
172
+ * description: project_path not set.
173
+ */
174
+ router.patch('/:key', async (c) => {
175
+ const commands = c.get('commands');
176
+ const key = c.req.param('key');
177
+ if (!key) {
178
+ return c.text('No search key', 400);
179
+ }
180
+ const body = await c.req.json();
181
+ let successes = 0;
182
+ const errors = [];
183
+ if (body.state) {
184
+ try {
185
+ await commands.transitionCmd.cardTransition(key, body.state);
186
+ successes++;
187
+ }
188
+ catch (error) {
189
+ if (error instanceof Error)
190
+ errors.push(error.message);
191
+ }
192
+ }
193
+ if (body.content != null) {
194
+ try {
195
+ await commands.editCmd.editCardContent(key, body.content);
196
+ successes++;
197
+ }
198
+ catch (error) {
199
+ if (error instanceof Error)
200
+ errors.push(error.message);
201
+ }
202
+ }
203
+ if (body.metadata) {
204
+ for (const [metadataKey, metadataValue] of Object.entries(body.metadata)) {
205
+ const value = metadataValue;
206
+ try {
207
+ await commands.editCmd.editCardMetadata(key, metadataKey, value);
208
+ successes++;
209
+ }
210
+ catch (error) {
211
+ if (error instanceof Error)
212
+ errors.push(error.message);
213
+ }
214
+ }
215
+ }
216
+ if (body.parent) {
217
+ try {
218
+ await commands.moveCmd.moveCard(key, body.parent);
219
+ successes++;
220
+ }
221
+ catch (error) {
222
+ if (error instanceof Error)
223
+ errors.push(error.message);
224
+ }
225
+ }
226
+ if (body.index != null) {
227
+ try {
228
+ await commands.moveCmd.rankByIndex(key, body.index);
229
+ successes++;
230
+ }
231
+ catch (error) {
232
+ if (error instanceof Error)
233
+ errors.push(error.message);
234
+ }
235
+ }
236
+ if (errors.length > 0) {
237
+ return c.text(errors.join('\n'), 400);
238
+ }
239
+ const result = await getCardDetails(commands, key);
240
+ if (result.status === 200) {
241
+ return c.json(result.data);
242
+ }
243
+ else {
244
+ return c.text(result.message || 'Unknown error', result.status);
245
+ }
246
+ });
247
+ /**
248
+ * @swagger
249
+ * /api/cards/{key}:
250
+ * delete:
251
+ * summary: Delete a card
252
+ * description: The key parameter is the unique identifier ("cardKey") of the card.
253
+ * parameters:
254
+ * - name: key
255
+ * in: path
256
+ * required: true
257
+ * description: Card key (string)
258
+ *
259
+ * responses:
260
+ * 204:
261
+ * description: Card deleted successfully.
262
+ * 400:
263
+ * description: Error. Card not found. Error message in response body.
264
+ * 500:
265
+ * description: project_path not set.
266
+ */
267
+ router.delete('/:key', async (c) => {
268
+ const commands = c.get('commands');
269
+ const key = c.req.param('key');
270
+ if (!key) {
271
+ return c.text('No search key', 400);
272
+ }
273
+ try {
274
+ await commands.removeCmd.remove('card', key);
275
+ return new Response(null, { status: 204 });
276
+ }
277
+ catch (error) {
278
+ return c.text(error instanceof Error ? error.message : 'Unknown error', 400);
279
+ }
280
+ });
281
+ /**
282
+ * @swagger
283
+ * /api/cards/{key}:
284
+ * post:
285
+ * summary: Create a new card
286
+ * description: Creates a new card using the specified template. If key is 'root', creates at root level.
287
+ * parameters:
288
+ * - name: key
289
+ * in: path
290
+ * required: true
291
+ * description: Card key (string)
292
+ * - name: template
293
+ * in: body
294
+ * required: true
295
+ * description: Template to use for creating the card
296
+ * responses:
297
+ * 200:
298
+ * description: Card created successfully
299
+ * 400:
300
+ * description: Error creating card or missing template
301
+ * 500:
302
+ * description: project_path not set
303
+ */
304
+ router.post('/:key', async (c) => {
305
+ const key = c.req.param('key');
306
+ if (!key) {
307
+ return c.text('No search key', 400);
308
+ }
309
+ const body = await c.req.json();
310
+ if (!body.template) {
311
+ return c.text('template is required', 400);
312
+ }
313
+ try {
314
+ const result = await c
315
+ .get('commands')
316
+ .createCmd.createCard(body.template, key === 'root' ? undefined : key);
317
+ if (result.length === 0) {
318
+ return c.json({ error: 'No cards created' }, 400);
319
+ }
320
+ return c.json(result);
321
+ }
322
+ catch (error) {
323
+ if (error instanceof Error) {
324
+ return c.text(error.message, 400);
325
+ }
326
+ return c.text('Unknown error occurred', 500);
327
+ }
328
+ });
329
+ /**
330
+ * @swagger
331
+ * /api/cards/{key}/attachments:
332
+ * post:
333
+ * summary: Upload attachments to a card
334
+ * parameters:
335
+ * - name: key
336
+ * in: path
337
+ * required: true
338
+ * schema:
339
+ * type: string
340
+ * requestBody:
341
+ * content:
342
+ * multipart/form-data:
343
+ * schema:
344
+ * type: object
345
+ * properties:
346
+ * file:
347
+ * type: array
348
+ * items:
349
+ * type: string
350
+ * format: binary
351
+ * responses:
352
+ * 200:
353
+ * description: Attachments uploaded successfully
354
+ * 400:
355
+ * description: Invalid request
356
+ * 500:
357
+ * description: Server error
358
+ */
359
+ router.post('/:key/attachments', async (c) => {
360
+ const commands = c.get('commands');
361
+ const key = c.req.param('key');
362
+ try {
363
+ const formData = await c.req.formData();
364
+ const files = formData.getAll('files');
365
+ if (!files || files.length === 0) {
366
+ return c.json({ error: 'No files uploaded' }, 400);
367
+ }
368
+ const succeeded = [];
369
+ for (const file of files) {
370
+ if (file instanceof File) {
371
+ const buffer = await file.arrayBuffer();
372
+ await commands.createCmd.createAttachment(key, file.name, Buffer.from(buffer));
373
+ succeeded.push(file.name);
374
+ }
375
+ }
376
+ return c.json({
377
+ message: 'Attachments uploaded successfully',
378
+ files: succeeded,
379
+ });
380
+ }
381
+ catch (error) {
382
+ return c.json({
383
+ error: error instanceof Error
384
+ ? error.message
385
+ : 'Failed to upload attachments',
386
+ }, 500);
387
+ }
388
+ });
389
+ /**
390
+ * @swagger
391
+ * /api/cards/{key}/attachments/{filename}:
392
+ * delete:
393
+ * summary: Remove an attachment from a card
394
+ * parameters:
395
+ * - name: key
396
+ * in: path
397
+ * required: true
398
+ * schema:
399
+ * type: string
400
+ * - name: filename
401
+ * in: path
402
+ * required: true
403
+ * schema:
404
+ * type: string
405
+ * responses:
406
+ * 200:
407
+ * description: Attachment removed successfully
408
+ * 400:
409
+ * description: Invalid request
410
+ * 500:
411
+ * description: Server error
412
+ */
413
+ router.delete('/:key/attachments/:filename', async (c) => {
414
+ const commands = c.get('commands');
415
+ const { key, filename } = c.req.param();
416
+ try {
417
+ await commands.removeCmd.remove('attachment', key, filename);
418
+ return c.json({ message: 'Attachment removed successfully' });
419
+ }
420
+ catch (error) {
421
+ return c.json({
422
+ error: error instanceof Error
423
+ ? error.message
424
+ : 'Failed to remove attachment',
425
+ }, 500);
426
+ }
427
+ });
428
+ /**
429
+ * @swagger
430
+ * /api/cards/{key}/attachments/{filename}/open:
431
+ * post:
432
+ * summary: Open an attachment using the system's default application
433
+ * parameters:
434
+ * - name: key
435
+ * in: path
436
+ * required: true
437
+ * schema:
438
+ * type: string
439
+ * - name: filename
440
+ * in: path
441
+ * required: true
442
+ * schema:
443
+ * type: string
444
+ * responses:
445
+ * 200:
446
+ * description: Attachment opened successfully
447
+ * 400:
448
+ * description: Invalid request
449
+ * 500:
450
+ * description: Server error
451
+ */
452
+ router.post('/:key/attachments/:filename/open', async (c) => {
453
+ const commands = c.get('commands');
454
+ const { key, filename } = c.req.param();
455
+ try {
456
+ await commands.showCmd.openAttachment(key, filename);
457
+ return c.json({ message: 'Attachment opened successfully' });
458
+ }
459
+ catch (error) {
460
+ return c.json({
461
+ error: error instanceof Error ? error.message : 'Failed to open attachment',
462
+ }, 500);
463
+ }
464
+ });
465
+ /**
466
+ * @swagger
467
+ * /api/cards/{key}/parse:
468
+ * post:
469
+ * summary: Parse card content
470
+ * parameters:
471
+ * - name: key
472
+ * in: path
473
+ * required: true
474
+ * schema:
475
+ * type: string
476
+ * requestBody:
477
+ * content:
478
+ * application/json:
479
+ * schema:
480
+ * type: object
481
+ * properties:
482
+ * content:
483
+ * type: string
484
+ * responses:
485
+ * 200:
486
+ * description: Content parsed successfully
487
+ * 400:
488
+ * description: Invalid request
489
+ * 500:
490
+ * description: Server error
491
+ */
492
+ router.post('/:key/parse', async (c) => {
493
+ const commands = c.get('commands');
494
+ const key = c.req.param('key');
495
+ const { content } = await c.req.json();
496
+ if (content == null) {
497
+ return c.json({ error: 'Content is required' }, 400);
498
+ }
499
+ try {
500
+ let asciidocContent = '';
501
+ try {
502
+ asciidocContent = await evaluateMacros(content, {
503
+ mode: 'inject',
504
+ projectPath: commands.project.basePath || '',
505
+ cardKey: key,
506
+ });
507
+ }
508
+ catch (error) {
509
+ asciidocContent = `Macro error: ${error instanceof Error ? error.message : 'Unknown error'}\n\n${content}`;
510
+ }
511
+ const processor = Processor();
512
+ const parsedContent = processor
513
+ .convert(asciidocContent, {
514
+ safe: 'safe',
515
+ attributes: {
516
+ imagesdir: `/api/cards/${key}/a`,
517
+ icons: 'font',
518
+ },
519
+ })
520
+ .toString();
521
+ return c.json({ parsedContent });
522
+ }
523
+ catch (error) {
524
+ return c.json({
525
+ error: error instanceof Error ? error.message : 'Failed to parse content',
526
+ }, 500);
527
+ }
528
+ });
529
+ /**
530
+ * @swagger
531
+ * /api/cards/{key}/links:
532
+ * post:
533
+ * summary: Create a link between cards
534
+ * parameters:
535
+ * - name: key
536
+ * in: path
537
+ * required: true
538
+ * schema:
539
+ * type: string
540
+ * requestBody:
541
+ * content:
542
+ * application/json:
543
+ * schema:
544
+ * type: object
545
+ * properties:
546
+ * toCard:
547
+ * type: string
548
+ * linkType:
549
+ * type: string
550
+ * description:
551
+ * type: string
552
+ * responses:
553
+ * 200:
554
+ * description: Link created successfully
555
+ * 400:
556
+ * description: Invalid request
557
+ * 500:
558
+ * description: Server error
559
+ */
560
+ router.post('/:key/links', async (c) => {
561
+ const commands = c.get('commands');
562
+ const key = c.req.param('key');
563
+ const { toCard, linkType, description } = await c.req.json();
564
+ if (!toCard || !linkType) {
565
+ return c.json({ error: 'toCard and linkType are required' }, 400);
566
+ }
567
+ try {
568
+ await commands.createCmd.createLink(key, toCard, linkType, description);
569
+ return c.json({ message: 'Link created successfully' });
570
+ }
571
+ catch (error) {
572
+ return c.json({
573
+ error: error instanceof Error ? error.message : 'Failed to create link',
574
+ }, 500);
575
+ }
576
+ });
577
+ /**
578
+ * @swagger
579
+ * /api/cards/{key}/links:
580
+ * delete:
581
+ * summary: Remove a link between cards
582
+ * parameters:
583
+ * - name: key
584
+ * in: path
585
+ * required: true
586
+ * schema:
587
+ * type: string
588
+ * requestBody:
589
+ * content:
590
+ * application/json:
591
+ * schema:
592
+ * type: object
593
+ * properties:
594
+ * toCard:
595
+ * type: string
596
+ * linkType:
597
+ * type: string
598
+ * description:
599
+ * type: string
600
+ * responses:
601
+ * 200:
602
+ * description: Link removed successfully
603
+ * 400:
604
+ * description: Invalid request
605
+ * 500:
606
+ * description: Server error
607
+ */
608
+ router.delete('/:key/links', async (c) => {
609
+ const commands = c.get('commands');
610
+ const key = c.req.param('key');
611
+ const { toCard, linkType, description } = await c.req.json();
612
+ if (!toCard || !linkType) {
613
+ return c.json({ error: 'toCard and linkType are required' }, 400);
614
+ }
615
+ try {
616
+ await commands.removeCmd.remove('link', key, toCard, linkType, description);
617
+ return c.json({ message: 'Link removed successfully' });
618
+ }
619
+ catch (error) {
620
+ return c.json({
621
+ error: error instanceof Error ? error.message : 'Failed to remove link',
622
+ }, 500);
623
+ }
624
+ });
625
+ /**
626
+ * @swagger
627
+ * /api/cards/{key}/a/{attachment}:
628
+ * get:
629
+ * summary: Returns an attachment file for a specific card.
630
+ * parameters:
631
+ * - name: key
632
+ * in: path
633
+ * required: true
634
+ * description: Card key (string)
635
+ * - name: attachment
636
+ * in: path
637
+ * required: true
638
+ * description: file name of the attachment
639
+ * responses:
640
+ * 200:
641
+ * description: Attachment object as a file buffer, content-type set to the mime type of the file
642
+ * 400:
643
+ * description: No search key or card not found with given key
644
+ * 404:
645
+ * description: Attachment file not found
646
+ * 500:
647
+ * description: project_path not set.
648
+ */
649
+ router.get('/:key/a/:attachment', async (c) => {
650
+ const commands = c.get('commands');
651
+ const { key, attachment } = c.req.param();
652
+ const filename = decodeURI(attachment);
653
+ if (!filename || !key) {
654
+ return c.text('Missing cardKey or filename', 400);
655
+ }
656
+ try {
657
+ const attachmentResponse = await commands.showCmd.showAttachment(key, filename);
658
+ if (!attachmentResponse) {
659
+ return c.text(`No attachment found from card ${key} and filename ${filename}`, 404);
660
+ }
661
+ const payload = attachmentResponse;
662
+ return new Response(payload.fileBuffer, {
663
+ headers: {
664
+ 'Content-Type': payload.mimeType,
665
+ 'Content-Disposition': `attachment; filename="${filename}"`,
666
+ 'Cache-Control': 'no-store',
667
+ },
668
+ });
669
+ }
670
+ catch {
671
+ return c.text(`No attachment found from card ${key} and filename ${filename}`, 404);
672
+ }
673
+ });
674
+ export default router;
675
+ //# sourceMappingURL=cards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cards.js","sourceRoot":"","sources":["../../src/routes/cards.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