@mdguggenbichler/slugbase-core 0.0.17 → 0.0.18
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/backend/dist/app-factory.d.ts +1 -1
- package/backend/dist/app-factory.d.ts.map +1 -1
- package/backend/dist/app-factory.js +2 -13
- package/backend/dist/app-factory.js.map +1 -1
- package/backend/dist/index.js +1 -1
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/routes/admin/settings.d.ts.map +1 -1
- package/backend/dist/routes/admin/settings.js +0 -281
- package/backend/dist/routes/admin/settings.js.map +1 -1
- package/backend/dist/routes/admin/stats.d.ts.map +1 -1
- package/backend/dist/routes/admin/stats.js +0 -39
- package/backend/dist/routes/admin/stats.js.map +1 -1
- package/backend/dist/routes/admin/teams.d.ts.map +1 -1
- package/backend/dist/routes/admin/teams.js +0 -344
- package/backend/dist/routes/admin/teams.js.map +1 -1
- package/backend/dist/routes/admin/users.d.ts.map +1 -1
- package/backend/dist/routes/admin/users.js +0 -317
- package/backend/dist/routes/admin/users.js.map +1 -1
- package/backend/dist/routes/auth.d.ts.map +1 -1
- package/backend/dist/routes/auth.js +0 -284
- package/backend/dist/routes/auth.js.map +1 -1
- package/backend/dist/routes/bookmarks.d.ts.map +1 -1
- package/backend/dist/routes/bookmarks.js +0 -522
- package/backend/dist/routes/bookmarks.js.map +1 -1
- package/backend/dist/routes/config.d.ts.map +1 -1
- package/backend/dist/routes/config.js +0 -27
- package/backend/dist/routes/config.js.map +1 -1
- package/backend/dist/routes/csrf.d.ts.map +1 -1
- package/backend/dist/routes/csrf.js +0 -24
- package/backend/dist/routes/csrf.js.map +1 -1
- package/backend/dist/routes/dashboard.d.ts.map +1 -1
- package/backend/dist/routes/dashboard.js +0 -35
- package/backend/dist/routes/dashboard.js.map +1 -1
- package/backend/dist/routes/email-verification.d.ts.map +1 -1
- package/backend/dist/routes/email-verification.js +0 -53
- package/backend/dist/routes/email-verification.js.map +1 -1
- package/backend/dist/routes/folders.d.ts.map +1 -1
- package/backend/dist/routes/folders.js +0 -217
- package/backend/dist/routes/folders.js.map +1 -1
- package/backend/dist/routes/go.d.ts.map +1 -1
- package/backend/dist/routes/go.js +0 -95
- package/backend/dist/routes/go.js.map +1 -1
- package/backend/dist/routes/health.d.ts.map +1 -1
- package/backend/dist/routes/health.js +0 -45
- package/backend/dist/routes/health.js.map +1 -1
- package/backend/dist/routes/oidc-providers.d.ts.map +1 -1
- package/backend/dist/routes/oidc-providers.js +0 -221
- package/backend/dist/routes/oidc-providers.js.map +1 -1
- package/backend/dist/routes/password-reset.d.ts.map +1 -1
- package/backend/dist/routes/password-reset.js +0 -67
- package/backend/dist/routes/password-reset.js.map +1 -1
- package/backend/dist/routes/tags.d.ts.map +1 -1
- package/backend/dist/routes/tags.js +0 -174
- package/backend/dist/routes/tags.js.map +1 -1
- package/backend/dist/routes/teams.d.ts.map +1 -1
- package/backend/dist/routes/teams.js +0 -36
- package/backend/dist/routes/teams.js.map +1 -1
- package/backend/dist/routes/tokens.d.ts.map +1 -1
- package/backend/dist/routes/tokens.js +0 -108
- package/backend/dist/routes/tokens.js.map +1 -1
- package/backend/dist/routes/users.d.ts.map +1 -1
- package/backend/dist/routes/users.js +0 -81
- package/backend/dist/routes/users.js.map +1 -1
- package/package.json +1 -1
|
@@ -25,103 +25,6 @@ async function recordAiSuggestionUsage(userId, used) {
|
|
|
25
25
|
// Table may not exist yet; do not fail the bookmark request
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
29
|
-
* @swagger
|
|
30
|
-
* /api/bookmarks:
|
|
31
|
-
* get:
|
|
32
|
-
* summary: Get all bookmarks
|
|
33
|
-
* description: Returns all bookmarks for the authenticated user, including own bookmarks and bookmarks shared via teams or users. Supports filtering by folder and tag.
|
|
34
|
-
* tags: [Bookmarks]
|
|
35
|
-
* security:
|
|
36
|
-
* - cookieAuth: []
|
|
37
|
-
* - bearerAuth: []
|
|
38
|
-
* parameters:
|
|
39
|
-
* - in: query
|
|
40
|
-
* name: folder_id
|
|
41
|
-
* schema:
|
|
42
|
-
* type: string
|
|
43
|
-
* description: Filter bookmarks by folder ID
|
|
44
|
-
* example: "123e4567-e89b-12d3-a456-426614174000"
|
|
45
|
-
* - in: query
|
|
46
|
-
* name: tag_id
|
|
47
|
-
* schema:
|
|
48
|
-
* type: string
|
|
49
|
-
* description: Filter bookmarks by tag ID
|
|
50
|
-
* example: "123e4567-e89b-12d3-a456-426614174000"
|
|
51
|
-
* - in: query
|
|
52
|
-
* name: limit
|
|
53
|
-
* schema:
|
|
54
|
-
* type: integer
|
|
55
|
-
* default: 50
|
|
56
|
-
* description: Max items per page (1-100)
|
|
57
|
-
* - in: query
|
|
58
|
-
* name: offset
|
|
59
|
-
* schema:
|
|
60
|
-
* type: integer
|
|
61
|
-
* default: 0
|
|
62
|
-
* description: Number of items to skip
|
|
63
|
-
* responses:
|
|
64
|
-
* 200:
|
|
65
|
-
* description: List of bookmarks
|
|
66
|
-
* content:
|
|
67
|
-
* application/json:
|
|
68
|
-
* schema:
|
|
69
|
-
* type: array
|
|
70
|
-
* items:
|
|
71
|
-
* type: object
|
|
72
|
-
* properties:
|
|
73
|
-
* id:
|
|
74
|
-
* type: string
|
|
75
|
-
* example: "123e4567-e89b-12d3-a456-426614174000"
|
|
76
|
-
* title:
|
|
77
|
-
* type: string
|
|
78
|
-
* example: "Example Bookmark"
|
|
79
|
-
* url:
|
|
80
|
-
* type: string
|
|
81
|
-
* example: "https://example.com"
|
|
82
|
-
* slug:
|
|
83
|
-
* type: string
|
|
84
|
-
* nullable: true
|
|
85
|
-
* example: "example-slug"
|
|
86
|
-
* forwarding_enabled:
|
|
87
|
-
* type: boolean
|
|
88
|
-
* example: true
|
|
89
|
-
* bookmark_type:
|
|
90
|
-
* type: string
|
|
91
|
-
* enum: [own, shared]
|
|
92
|
-
* example: "own"
|
|
93
|
-
* folders:
|
|
94
|
-
* type: array
|
|
95
|
-
* items:
|
|
96
|
-
* type: object
|
|
97
|
-
* properties:
|
|
98
|
-
* id:
|
|
99
|
-
* type: string
|
|
100
|
-
* name:
|
|
101
|
-
* type: string
|
|
102
|
-
* icon:
|
|
103
|
-
* type: string
|
|
104
|
-
* nullable: true
|
|
105
|
-
* tags:
|
|
106
|
-
* type: array
|
|
107
|
-
* items:
|
|
108
|
-
* type: object
|
|
109
|
-
* properties:
|
|
110
|
-
* id:
|
|
111
|
-
* type: string
|
|
112
|
-
* name:
|
|
113
|
-
* type: string
|
|
114
|
-
* shared_teams:
|
|
115
|
-
* type: array
|
|
116
|
-
* items:
|
|
117
|
-
* type: object
|
|
118
|
-
* shared_users:
|
|
119
|
-
* type: array
|
|
120
|
-
* items:
|
|
121
|
-
* type: object
|
|
122
|
-
* 401:
|
|
123
|
-
* description: Unauthorized
|
|
124
|
-
*/
|
|
125
28
|
// Get all bookmarks for user (including shared bookmarks)
|
|
126
29
|
router.get('/', async (req, res) => {
|
|
127
30
|
const authReq = req;
|
|
@@ -445,79 +348,6 @@ router.get('/', async (req, res) => {
|
|
|
445
348
|
res.status(500).json({ error: error.message });
|
|
446
349
|
}
|
|
447
350
|
});
|
|
448
|
-
/**
|
|
449
|
-
* @swagger
|
|
450
|
-
* /api/bookmarks/{id}:
|
|
451
|
-
* get:
|
|
452
|
-
* summary: Get bookmark by ID
|
|
453
|
-
* description: Returns a single bookmark by ID. User must own the bookmark or have access via sharing.
|
|
454
|
-
* tags: [Bookmarks]
|
|
455
|
-
* security:
|
|
456
|
-
* - cookieAuth: []
|
|
457
|
-
* - bearerAuth: []
|
|
458
|
-
* parameters:
|
|
459
|
-
* - in: path
|
|
460
|
-
* name: id
|
|
461
|
-
* required: true
|
|
462
|
-
* schema:
|
|
463
|
-
* type: string
|
|
464
|
-
* description: Bookmark ID
|
|
465
|
-
* example: "123e4567-e89b-12d3-a456-426614174000"
|
|
466
|
-
* responses:
|
|
467
|
-
* 200:
|
|
468
|
-
* description: Bookmark details
|
|
469
|
-
* content:
|
|
470
|
-
* application/json:
|
|
471
|
-
* schema:
|
|
472
|
-
* type: object
|
|
473
|
-
* properties:
|
|
474
|
-
* id:
|
|
475
|
-
* type: string
|
|
476
|
-
* title:
|
|
477
|
-
* type: string
|
|
478
|
-
* url:
|
|
479
|
-
* type: string
|
|
480
|
-
* slug:
|
|
481
|
-
* type: string
|
|
482
|
-
* nullable: true
|
|
483
|
-
* forwarding_enabled:
|
|
484
|
-
* type: boolean
|
|
485
|
-
* folders:
|
|
486
|
-
* type: array
|
|
487
|
-
* tags:
|
|
488
|
-
* type: array
|
|
489
|
-
* shared_teams:
|
|
490
|
-
* type: array
|
|
491
|
-
* shared_users:
|
|
492
|
-
* type: array
|
|
493
|
-
* 404:
|
|
494
|
-
* description: Bookmark not found
|
|
495
|
-
* 401:
|
|
496
|
-
* description: Unauthorized
|
|
497
|
-
*/
|
|
498
|
-
/**
|
|
499
|
-
* @swagger
|
|
500
|
-
* /api/bookmarks/search:
|
|
501
|
-
* get:
|
|
502
|
-
* summary: Search bookmarks, folders, and tags
|
|
503
|
-
* description: Global search across bookmarks, folders, and tags
|
|
504
|
-
* tags: [Bookmarks]
|
|
505
|
-
* security:
|
|
506
|
-
* - cookieAuth: []
|
|
507
|
-
* - bearerAuth: []
|
|
508
|
-
* parameters:
|
|
509
|
-
* - in: query
|
|
510
|
-
* name: q
|
|
511
|
-
* required: true
|
|
512
|
-
* schema:
|
|
513
|
-
* type: string
|
|
514
|
-
* description: Search query
|
|
515
|
-
* responses:
|
|
516
|
-
* 200:
|
|
517
|
-
* description: Search results
|
|
518
|
-
* 401:
|
|
519
|
-
* description: Unauthorized
|
|
520
|
-
*/
|
|
521
351
|
// Search endpoint (must be before /:id route)
|
|
522
352
|
router.get('/search', async (req, res) => {
|
|
523
353
|
const authReq = req;
|
|
@@ -611,26 +441,6 @@ router.get('/search', async (req, res) => {
|
|
|
611
441
|
res.status(500).json({ error: 'Search failed' });
|
|
612
442
|
}
|
|
613
443
|
});
|
|
614
|
-
/**
|
|
615
|
-
* @swagger
|
|
616
|
-
* /api/bookmarks/export:
|
|
617
|
-
* get:
|
|
618
|
-
* summary: Export bookmarks as JSON
|
|
619
|
-
* description: Export all user's bookmarks as JSON
|
|
620
|
-
* tags: [Bookmarks]
|
|
621
|
-
* security:
|
|
622
|
-
* - cookieAuth: []
|
|
623
|
-
* - bearerAuth: []
|
|
624
|
-
* responses:
|
|
625
|
-
* 200:
|
|
626
|
-
* description: JSON export of bookmarks
|
|
627
|
-
* content:
|
|
628
|
-
* application/json:
|
|
629
|
-
* schema:
|
|
630
|
-
* type: array
|
|
631
|
-
* 401:
|
|
632
|
-
* description: Unauthorized
|
|
633
|
-
*/
|
|
634
444
|
// Export bookmarks as JSON (must be before /:id route)
|
|
635
445
|
router.get('/export', async (req, res) => {
|
|
636
446
|
const authReq = req;
|
|
@@ -793,51 +603,6 @@ router.get('/ids', async (req, res) => {
|
|
|
793
603
|
res.status(500).json({ error: 'Failed to fetch bookmark IDs' });
|
|
794
604
|
}
|
|
795
605
|
});
|
|
796
|
-
/**
|
|
797
|
-
* @swagger
|
|
798
|
-
* /api/bookmarks/ai-suggest:
|
|
799
|
-
* post:
|
|
800
|
-
* summary: Get AI suggestions for bookmark metadata
|
|
801
|
-
* description: Returns suggested title, slug, and tags for a URL. Requires AI feature enabled. Non-blocking; bookmark creation never depends on this.
|
|
802
|
-
* tags: [Bookmarks]
|
|
803
|
-
* security:
|
|
804
|
-
* - cookieAuth: []
|
|
805
|
-
* - bearerAuth: []
|
|
806
|
-
* requestBody:
|
|
807
|
-
* required: true
|
|
808
|
-
* content:
|
|
809
|
-
* application/json:
|
|
810
|
-
* schema:
|
|
811
|
-
* type: object
|
|
812
|
-
* required: [url]
|
|
813
|
-
* properties:
|
|
814
|
-
* url:
|
|
815
|
-
* type: string
|
|
816
|
-
* format: uri
|
|
817
|
-
* page_title:
|
|
818
|
-
* type: string
|
|
819
|
-
* responses:
|
|
820
|
-
* 200:
|
|
821
|
-
* description: AI suggestions
|
|
822
|
-
* content:
|
|
823
|
-
* application/json:
|
|
824
|
-
* schema:
|
|
825
|
-
* type: object
|
|
826
|
-
* properties:
|
|
827
|
-
* title: { type: string }
|
|
828
|
-
* slug: { type: string }
|
|
829
|
-
* tags: { type: array, items: { type: string } }
|
|
830
|
-
* language: { type: string }
|
|
831
|
-
* confidence: { type: number }
|
|
832
|
-
* 400:
|
|
833
|
-
* description: Invalid URL
|
|
834
|
-
* 403:
|
|
835
|
-
* description: AI feature disabled or not available for plan
|
|
836
|
-
* 408:
|
|
837
|
-
* description: AI request timeout
|
|
838
|
-
* 503:
|
|
839
|
-
* description: AI not configured
|
|
840
|
-
*/
|
|
841
606
|
router.post('/ai-suggest', async (req, res) => {
|
|
842
607
|
const authReq = req;
|
|
843
608
|
try {
|
|
@@ -977,31 +742,6 @@ router.get('/:id', async (req, res) => {
|
|
|
977
742
|
res.status(500).json({ error: error.message });
|
|
978
743
|
}
|
|
979
744
|
});
|
|
980
|
-
/**
|
|
981
|
-
* @swagger
|
|
982
|
-
* /api/bookmarks/{id}/track-access:
|
|
983
|
-
* post:
|
|
984
|
-
* summary: Track bookmark access
|
|
985
|
-
* description: Increments access_count and updates last_accessed_at for a bookmark when it is opened
|
|
986
|
-
* tags: [Bookmarks]
|
|
987
|
-
* security:
|
|
988
|
-
* - cookieAuth: []
|
|
989
|
-
* - bearerAuth: []
|
|
990
|
-
* parameters:
|
|
991
|
-
* - in: path
|
|
992
|
-
* name: id
|
|
993
|
-
* required: true
|
|
994
|
-
* schema:
|
|
995
|
-
* type: string
|
|
996
|
-
* description: Bookmark ID
|
|
997
|
-
* responses:
|
|
998
|
-
* 200:
|
|
999
|
-
* description: Access tracked successfully
|
|
1000
|
-
* 404:
|
|
1001
|
-
* description: Bookmark not found
|
|
1002
|
-
* 401:
|
|
1003
|
-
* description: Unauthorized
|
|
1004
|
-
*/
|
|
1005
745
|
// Track bookmark access (must be before PUT /:id)
|
|
1006
746
|
router.post('/:id/track-access', async (req, res) => {
|
|
1007
747
|
const authReq = req;
|
|
@@ -1025,97 +765,6 @@ router.post('/:id/track-access', async (req, res) => {
|
|
|
1025
765
|
res.status(500).json({ error: error.message });
|
|
1026
766
|
}
|
|
1027
767
|
});
|
|
1028
|
-
/**
|
|
1029
|
-
* @swagger
|
|
1030
|
-
* /api/bookmarks:
|
|
1031
|
-
* post:
|
|
1032
|
-
* summary: Create a new bookmark
|
|
1033
|
-
* description: Creates a new bookmark. Slug is required only if forwarding is enabled. Can assign to multiple folders, tags, and share with users/teams.
|
|
1034
|
-
* tags: [Bookmarks]
|
|
1035
|
-
* security:
|
|
1036
|
-
* - cookieAuth: []
|
|
1037
|
-
* - bearerAuth: []
|
|
1038
|
-
* requestBody:
|
|
1039
|
-
* required: true
|
|
1040
|
-
* content:
|
|
1041
|
-
* application/json:
|
|
1042
|
-
* schema:
|
|
1043
|
-
* type: object
|
|
1044
|
-
* required:
|
|
1045
|
-
* - title
|
|
1046
|
-
* - url
|
|
1047
|
-
* properties:
|
|
1048
|
-
* title:
|
|
1049
|
-
* type: string
|
|
1050
|
-
* example: "Example Bookmark"
|
|
1051
|
-
* url:
|
|
1052
|
-
* type: string
|
|
1053
|
-
* format: uri
|
|
1054
|
-
* example: "https://example.com"
|
|
1055
|
-
* slug:
|
|
1056
|
-
* type: string
|
|
1057
|
-
* nullable: true
|
|
1058
|
-
* description: Required if forwarding_enabled is true, optional otherwise
|
|
1059
|
-
* example: "example-slug"
|
|
1060
|
-
* forwarding_enabled:
|
|
1061
|
-
* type: boolean
|
|
1062
|
-
* default: false
|
|
1063
|
-
* example: true
|
|
1064
|
-
* folder_ids:
|
|
1065
|
-
* type: array
|
|
1066
|
-
* items:
|
|
1067
|
-
* type: string
|
|
1068
|
-
* description: Array of folder IDs to assign bookmark to
|
|
1069
|
-
* example: ["123e4567-e89b-12d3-a456-426614174000"]
|
|
1070
|
-
* tag_ids:
|
|
1071
|
-
* type: array
|
|
1072
|
-
* items:
|
|
1073
|
-
* type: string
|
|
1074
|
-
* description: Array of tag IDs to assign to bookmark
|
|
1075
|
-
* example: ["123e4567-e89b-12d3-a456-426614174000"]
|
|
1076
|
-
* team_ids:
|
|
1077
|
-
* type: array
|
|
1078
|
-
* items:
|
|
1079
|
-
* type: string
|
|
1080
|
-
* description: Array of team IDs to share bookmark with
|
|
1081
|
-
* example: ["123e4567-e89b-12d3-a456-426614174000"]
|
|
1082
|
-
* user_ids:
|
|
1083
|
-
* type: array
|
|
1084
|
-
* items:
|
|
1085
|
-
* type: string
|
|
1086
|
-
* description: Array of user IDs to share bookmark with
|
|
1087
|
-
* example: ["123e4567-e89b-12d3-a456-426614174000"]
|
|
1088
|
-
* share_all_teams:
|
|
1089
|
-
* type: boolean
|
|
1090
|
-
* default: false
|
|
1091
|
-
* description: Share bookmark with all teams user is a member of
|
|
1092
|
-
* example: false
|
|
1093
|
-
* responses:
|
|
1094
|
-
* 201:
|
|
1095
|
-
* description: Bookmark created successfully
|
|
1096
|
-
* content:
|
|
1097
|
-
* application/json:
|
|
1098
|
-
* schema:
|
|
1099
|
-
* type: object
|
|
1100
|
-
* properties:
|
|
1101
|
-
* id:
|
|
1102
|
-
* type: string
|
|
1103
|
-
* title:
|
|
1104
|
-
* type: string
|
|
1105
|
-
* url:
|
|
1106
|
-
* type: string
|
|
1107
|
-
* slug:
|
|
1108
|
-
* type: string
|
|
1109
|
-
* nullable: true
|
|
1110
|
-
* forwarding_enabled:
|
|
1111
|
-
* type: boolean
|
|
1112
|
-
* 400:
|
|
1113
|
-
* description: Missing required fields, slug required when forwarding enabled, or slug already exists
|
|
1114
|
-
* 401:
|
|
1115
|
-
* description: Unauthorized
|
|
1116
|
-
* 403:
|
|
1117
|
-
* description: User does not own folder or is not member of team
|
|
1118
|
-
*/
|
|
1119
768
|
// Create bookmark
|
|
1120
769
|
router.post('/', async (req, res) => {
|
|
1121
770
|
const authReq = req;
|
|
@@ -1224,81 +873,6 @@ router.post('/', async (req, res) => {
|
|
|
1224
873
|
res.status(500).json({ error: error.message });
|
|
1225
874
|
}
|
|
1226
875
|
});
|
|
1227
|
-
/**
|
|
1228
|
-
* @swagger
|
|
1229
|
-
* /api/bookmarks/{id}:
|
|
1230
|
-
* put:
|
|
1231
|
-
* summary: Update bookmark
|
|
1232
|
-
* description: Updates an existing bookmark. User must own the bookmark. All fields are optional.
|
|
1233
|
-
* tags: [Bookmarks]
|
|
1234
|
-
* security:
|
|
1235
|
-
* - cookieAuth: []
|
|
1236
|
-
* - bearerAuth: []
|
|
1237
|
-
* parameters:
|
|
1238
|
-
* - in: path
|
|
1239
|
-
* name: id
|
|
1240
|
-
* required: true
|
|
1241
|
-
* schema:
|
|
1242
|
-
* type: string
|
|
1243
|
-
* description: Bookmark ID
|
|
1244
|
-
* example: "123e4567-e89b-12d3-a456-426614174000"
|
|
1245
|
-
* requestBody:
|
|
1246
|
-
* required: true
|
|
1247
|
-
* content:
|
|
1248
|
-
* application/json:
|
|
1249
|
-
* schema:
|
|
1250
|
-
* type: object
|
|
1251
|
-
* properties:
|
|
1252
|
-
* title:
|
|
1253
|
-
* type: string
|
|
1254
|
-
* example: "Updated Bookmark Title"
|
|
1255
|
-
* url:
|
|
1256
|
-
* type: string
|
|
1257
|
-
* format: uri
|
|
1258
|
-
* example: "https://updated-example.com"
|
|
1259
|
-
* slug:
|
|
1260
|
-
* type: string
|
|
1261
|
-
* nullable: true
|
|
1262
|
-
* description: Required if forwarding_enabled is true
|
|
1263
|
-
* example: "updated-slug"
|
|
1264
|
-
* forwarding_enabled:
|
|
1265
|
-
* type: boolean
|
|
1266
|
-
* example: true
|
|
1267
|
-
* folder_ids:
|
|
1268
|
-
* type: array
|
|
1269
|
-
* items:
|
|
1270
|
-
* type: string
|
|
1271
|
-
* description: Array of folder IDs (replaces existing assignments)
|
|
1272
|
-
* tag_ids:
|
|
1273
|
-
* type: array
|
|
1274
|
-
* items:
|
|
1275
|
-
* type: string
|
|
1276
|
-
* description: Array of tag IDs (replaces existing assignments)
|
|
1277
|
-
* team_ids:
|
|
1278
|
-
* type: array
|
|
1279
|
-
* items:
|
|
1280
|
-
* type: string
|
|
1281
|
-
* description: Array of team IDs to share with (replaces existing shares)
|
|
1282
|
-
* user_ids:
|
|
1283
|
-
* type: array
|
|
1284
|
-
* items:
|
|
1285
|
-
* type: string
|
|
1286
|
-
* description: Array of user IDs to share with (replaces existing shares)
|
|
1287
|
-
* share_all_teams:
|
|
1288
|
-
* type: boolean
|
|
1289
|
-
* description: Share with all teams user is a member of
|
|
1290
|
-
* responses:
|
|
1291
|
-
* 200:
|
|
1292
|
-
* description: Bookmark updated successfully
|
|
1293
|
-
* 400:
|
|
1294
|
-
* description: Slug required when forwarding enabled or slug already exists
|
|
1295
|
-
* 401:
|
|
1296
|
-
* description: Unauthorized
|
|
1297
|
-
* 403:
|
|
1298
|
-
* description: User does not own folder or is not member of team
|
|
1299
|
-
* 404:
|
|
1300
|
-
* description: Bookmark not found
|
|
1301
|
-
*/
|
|
1302
876
|
// Update bookmark
|
|
1303
877
|
router.put('/:id', async (req, res) => {
|
|
1304
878
|
const authReq = req;
|
|
@@ -1457,40 +1031,6 @@ router.put('/:id', async (req, res) => {
|
|
|
1457
1031
|
res.status(500).json({ error: error.message });
|
|
1458
1032
|
}
|
|
1459
1033
|
});
|
|
1460
|
-
/**
|
|
1461
|
-
* @swagger
|
|
1462
|
-
* /api/bookmarks/{id}:
|
|
1463
|
-
* delete:
|
|
1464
|
-
* summary: Delete bookmark
|
|
1465
|
-
* description: Deletes a bookmark. User must own the bookmark.
|
|
1466
|
-
* tags: [Bookmarks]
|
|
1467
|
-
* security:
|
|
1468
|
-
* - cookieAuth: []
|
|
1469
|
-
* - bearerAuth: []
|
|
1470
|
-
* parameters:
|
|
1471
|
-
* - in: path
|
|
1472
|
-
* name: id
|
|
1473
|
-
* required: true
|
|
1474
|
-
* schema:
|
|
1475
|
-
* type: string
|
|
1476
|
-
* description: Bookmark ID
|
|
1477
|
-
* example: "123e4567-e89b-12d3-a456-426614174000"
|
|
1478
|
-
* responses:
|
|
1479
|
-
* 200:
|
|
1480
|
-
* description: Bookmark deleted successfully
|
|
1481
|
-
* content:
|
|
1482
|
-
* application/json:
|
|
1483
|
-
* schema:
|
|
1484
|
-
* type: object
|
|
1485
|
-
* properties:
|
|
1486
|
-
* message:
|
|
1487
|
-
* type: string
|
|
1488
|
-
* example: "Bookmark deleted"
|
|
1489
|
-
* 401:
|
|
1490
|
-
* description: Unauthorized
|
|
1491
|
-
* 404:
|
|
1492
|
-
* description: Bookmark not found
|
|
1493
|
-
*/
|
|
1494
1034
|
// Delete bookmark
|
|
1495
1035
|
router.delete('/:id', async (req, res) => {
|
|
1496
1036
|
const authReq = req;
|
|
@@ -1509,68 +1049,6 @@ router.delete('/:id', async (req, res) => {
|
|
|
1509
1049
|
res.status(500).json({ error: error.message });
|
|
1510
1050
|
}
|
|
1511
1051
|
});
|
|
1512
|
-
/**
|
|
1513
|
-
* @swagger
|
|
1514
|
-
* /api/bookmarks/search:
|
|
1515
|
-
* get:
|
|
1516
|
-
* summary: Search bookmarks, folders, and tags
|
|
1517
|
-
* description: Search across bookmarks, folders, and tags for the authenticated user
|
|
1518
|
-
* tags: [Bookmarks]
|
|
1519
|
-
* security:
|
|
1520
|
-
* - cookieAuth: []
|
|
1521
|
-
* - bearerAuth: []
|
|
1522
|
-
* parameters:
|
|
1523
|
-
* - in: query
|
|
1524
|
-
* name: q
|
|
1525
|
-
* required: true
|
|
1526
|
-
* schema:
|
|
1527
|
-
* type: string
|
|
1528
|
-
* description: Search query
|
|
1529
|
-
* example: "example"
|
|
1530
|
-
* responses:
|
|
1531
|
-
* 200:
|
|
1532
|
-
* description: Search results
|
|
1533
|
-
* 401:
|
|
1534
|
-
* description: Unauthorized
|
|
1535
|
-
*/
|
|
1536
|
-
/**
|
|
1537
|
-
* @swagger
|
|
1538
|
-
* /api/bookmarks/import:
|
|
1539
|
-
* post:
|
|
1540
|
-
* summary: Import bookmarks from JSON
|
|
1541
|
-
* description: Import bookmarks from a JSON array
|
|
1542
|
-
* tags: [Bookmarks]
|
|
1543
|
-
* security:
|
|
1544
|
-
* - cookieAuth: []
|
|
1545
|
-
* - bearerAuth: []
|
|
1546
|
-
* requestBody:
|
|
1547
|
-
* required: true
|
|
1548
|
-
* content:
|
|
1549
|
-
* application/json:
|
|
1550
|
-
* schema:
|
|
1551
|
-
* type: object
|
|
1552
|
-
* properties:
|
|
1553
|
-
* bookmarks:
|
|
1554
|
-
* type: array
|
|
1555
|
-
* items:
|
|
1556
|
-
* type: object
|
|
1557
|
-
* properties:
|
|
1558
|
-
* title:
|
|
1559
|
-
* type: string
|
|
1560
|
-
* url:
|
|
1561
|
-
* type: string
|
|
1562
|
-
* slug:
|
|
1563
|
-
* type: string
|
|
1564
|
-
* forwarding_enabled:
|
|
1565
|
-
* type: boolean
|
|
1566
|
-
* responses:
|
|
1567
|
-
* 200:
|
|
1568
|
-
* description: Import successful
|
|
1569
|
-
* 400:
|
|
1570
|
-
* description: Invalid import data
|
|
1571
|
-
* 401:
|
|
1572
|
-
* description: Unauthorized
|
|
1573
|
-
*/
|
|
1574
1052
|
// Import bookmarks from JSON
|
|
1575
1053
|
router.post('/import', async (req, res) => {
|
|
1576
1054
|
const authReq = req;
|