strapi-plugin-magic-mark 1.3.1 → 3.0.0

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.
@@ -59,6 +59,16 @@ declare const _default: {
59
59
  type: string;
60
60
  configurable: boolean;
61
61
  };
62
+ creatorId: {
63
+ type: string;
64
+ configurable: boolean;
65
+ description: string;
66
+ };
67
+ updaterId: {
68
+ type: string;
69
+ configurable: boolean;
70
+ description: string;
71
+ };
62
72
  sharedWithRoles: {
63
73
  type: string;
64
74
  configurable: boolean;
@@ -1,11 +1,49 @@
1
+ /**
2
+ * Bookmark Controller
3
+ * Handles HTTP requests for bookmark management
4
+ *
5
+ * Uses Document Service API (Strapi v5 Best Practice)
6
+ */
1
7
  declare const _default: ({ strapi }: any) => {
8
+ /**
9
+ * Get all bookmarks for current user
10
+ * GET /magic-mark/bookmarks
11
+ */
2
12
  getAll(ctx: any): Promise<any>;
13
+ /**
14
+ * Create a new bookmark
15
+ * POST /magic-mark/bookmarks
16
+ */
3
17
  create(ctx: any): Promise<any>;
18
+ /**
19
+ * Update an existing bookmark
20
+ * PUT /magic-mark/bookmarks/:id
21
+ */
4
22
  update(ctx: any): Promise<any>;
23
+ /**
24
+ * Delete a bookmark
25
+ * DELETE /magic-mark/bookmarks/:id
26
+ */
5
27
  delete(ctx: any): Promise<any>;
28
+ /**
29
+ * Pin or unpin a bookmark
30
+ * PUT /magic-mark/bookmarks/:id/pin
31
+ */
6
32
  pin(ctx: any): Promise<any>;
33
+ /**
34
+ * Reorder bookmarks
35
+ * PUT /magic-mark/bookmarks/reorder
36
+ */
7
37
  reorder(ctx: any): Promise<any>;
38
+ /**
39
+ * Get all admin roles for sharing
40
+ * GET /magic-mark/roles
41
+ */
8
42
  getRoles(ctx: any): Promise<any>;
43
+ /**
44
+ * Get all admin users for sharing
45
+ * GET /magic-mark/users
46
+ */
9
47
  getUsers(ctx: any): Promise<any>;
10
48
  };
11
49
  export default _default;
@@ -53,29 +53,17 @@ declare const _default: {
53
53
  bookmarks: ({ strapi }: {
54
54
  strapi: import("@strapi/types/dist/core").Strapi;
55
55
  }) => {
56
- findAll(userId: number): Promise<any>;
57
- create(name: string, path: string, query: string, emoji: string, description: string, userId: number, sharedWithRoles?: number[], sharedWithUsers?: number[], isPublic?: boolean): Promise<{
58
- id: import("@strapi/types/dist/data").ID;
59
- } & {
60
- [key: string]: any;
61
- }>;
62
- update(id: string | number, data: any, userId: number): Promise<{
63
- id: import("@strapi/types/dist/data").ID;
64
- } & {
65
- [key: string]: any;
56
+ findAll(userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument[]>;
57
+ create(name: string, path: string, query: string, emoji: string, description: string, userId: string, sharedWithRoles?: string[], sharedWithUsers?: string[], isPublic?: boolean): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
58
+ update(documentId: string, data: any, userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
59
+ delete(documentId: string): Promise<{
60
+ documentId: string;
61
+ entries: import("@strapi/types/dist/modules/documents").AnyDocument[];
66
62
  }>;
67
- delete(id: string | number): Promise<{
68
- id: import("@strapi/types/dist/data").ID;
69
- } & {
70
- [key: string]: any;
71
- }>;
72
- pin(id: string | number, isPinned: boolean, userId: number): Promise<{
73
- id: import("@strapi/types/dist/data").ID;
74
- } & {
75
- [key: string]: any;
76
- }>;
77
- reorder(bookmarkIds: (string | number)[], userId: number): Promise<({
78
- id: import("@strapi/types/dist/data").ID;
63
+ pin(documentId: string, isPinned: boolean, userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
64
+ reorder(bookmarkIds: string[], userId: string): Promise<({
65
+ documentId: string;
66
+ id: number;
79
67
  } & {
80
68
  [key: string]: any;
81
69
  })[]>;
@@ -165,6 +153,16 @@ declare const _default: {
165
153
  type: string;
166
154
  configurable: boolean;
167
155
  };
156
+ creatorId: {
157
+ type: string;
158
+ configurable: boolean;
159
+ description: string;
160
+ };
161
+ updaterId: {
162
+ type: string;
163
+ configurable: boolean;
164
+ description: string;
165
+ };
168
166
  sharedWithRoles: {
169
167
  type: string;
170
168
  configurable: boolean;
@@ -3,29 +3,17 @@ declare const _default: {
3
3
  bookmarks: ({ strapi }: {
4
4
  strapi: import("@strapi/types/dist/core").Strapi;
5
5
  }) => {
6
- findAll(userId: number): Promise<any>;
7
- create(name: string, path: string, query: string, emoji: string, description: string, userId: number, sharedWithRoles?: number[], sharedWithUsers?: number[], isPublic?: boolean): Promise<{
8
- id: import("@strapi/types/dist/data").ID;
9
- } & {
10
- [key: string]: any;
11
- }>;
12
- update(id: string | number, data: any, userId: number): Promise<{
13
- id: import("@strapi/types/dist/data").ID;
14
- } & {
15
- [key: string]: any;
16
- }>;
17
- delete(id: string | number): Promise<{
18
- id: import("@strapi/types/dist/data").ID;
19
- } & {
20
- [key: string]: any;
21
- }>;
22
- pin(id: string | number, isPinned: boolean, userId: number): Promise<{
23
- id: import("@strapi/types/dist/data").ID;
24
- } & {
25
- [key: string]: any;
6
+ findAll(userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument[]>;
7
+ create(name: string, path: string, query: string, emoji: string, description: string, userId: string, sharedWithRoles?: string[], sharedWithUsers?: string[], isPublic?: boolean): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
8
+ update(documentId: string, data: any, userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
9
+ delete(documentId: string): Promise<{
10
+ documentId: string;
11
+ entries: import("@strapi/types/dist/modules/documents").AnyDocument[];
26
12
  }>;
27
- reorder(bookmarkIds: (string | number)[], userId: number): Promise<({
28
- id: import("@strapi/types/dist/data").ID;
13
+ pin(documentId: string, isPinned: boolean, userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
14
+ reorder(bookmarkIds: string[], userId: string): Promise<({
15
+ documentId: string;
16
+ id: number;
29
17
  } & {
30
18
  [key: string]: any;
31
19
  })[]>;
@@ -1,33 +1,78 @@
1
1
  import type { Core } from '@strapi/strapi';
2
+ /**
3
+ * Bookmark Service
4
+ * Handles all bookmark-related database operations
5
+ *
6
+ * Uses Document Service API (Strapi v5 Best Practice)
7
+ *
8
+ * NOTE: We store creatorId/updaterId as strings (documentId) instead of relations
9
+ * to avoid permission issues with admin::user content-type.
10
+ */
2
11
  declare const bookmarkService: ({ strapi }: {
3
12
  strapi: Core.Strapi;
4
13
  }) => {
5
- findAll(userId: number): Promise<any>;
6
- create(name: string, path: string, query: string, emoji: string, description: string, userId: number, sharedWithRoles?: number[], sharedWithUsers?: number[], isPublic?: boolean): Promise<{
7
- id: import("@strapi/types/dist/data").ID;
8
- } & {
9
- [key: string]: any;
10
- }>;
11
- update(id: string | number, data: any, userId: number): Promise<{
12
- id: import("@strapi/types/dist/data").ID;
13
- } & {
14
- [key: string]: any;
15
- }>;
16
- delete(id: string | number): Promise<{
17
- id: import("@strapi/types/dist/data").ID;
18
- } & {
19
- [key: string]: any;
20
- }>;
21
- pin(id: string | number, isPinned: boolean, userId: number): Promise<{
22
- id: import("@strapi/types/dist/data").ID;
23
- } & {
24
- [key: string]: any;
14
+ /**
15
+ * Find all bookmarks accessible to a user
16
+ * @param userId - The admin user's documentId
17
+ * @returns Array of accessible bookmarks
18
+ */
19
+ findAll(userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument[]>;
20
+ /**
21
+ * Create a new bookmark
22
+ * @param name - Bookmark name
23
+ * @param path - URL path
24
+ * @param query - Query string
25
+ * @param emoji - Emoji icon
26
+ * @param description - Description
27
+ * @param userId - Creator's documentId
28
+ * @param sharedWithRoles - Array of role documentIds
29
+ * @param sharedWithUsers - Array of user documentIds
30
+ * @param isPublic - Public visibility
31
+ * @returns Created bookmark
32
+ */
33
+ create(name: string, path: string, query: string, emoji: string, description: string, userId: string, sharedWithRoles?: string[], sharedWithUsers?: string[], isPublic?: boolean): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
34
+ /**
35
+ * Update an existing bookmark
36
+ * @param documentId - Bookmark's documentId
37
+ * @param data - Update data
38
+ * @param userId - Editor's documentId
39
+ * @returns Updated bookmark
40
+ */
41
+ update(documentId: string, data: any, userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
42
+ /**
43
+ * Delete a bookmark
44
+ * @param documentId - Bookmark's documentId
45
+ * @returns Deleted bookmark
46
+ */
47
+ delete(documentId: string): Promise<{
48
+ documentId: string;
49
+ entries: import("@strapi/types/dist/modules/documents").AnyDocument[];
25
50
  }>;
26
- reorder(bookmarkIds: (string | number)[], userId: number): Promise<({
27
- id: import("@strapi/types/dist/data").ID;
51
+ /**
52
+ * Pin or unpin a bookmark
53
+ * @param documentId - Bookmark's documentId
54
+ * @param isPinned - Pin status
55
+ * @param userId - Editor's documentId
56
+ * @returns Updated bookmark
57
+ */
58
+ pin(documentId: string, isPinned: boolean, userId: string): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
59
+ /**
60
+ * Reorder bookmarks
61
+ * @param bookmarkIds - Array of bookmark documentIds in new order
62
+ * @param userId - Editor's documentId
63
+ * @returns Updated bookmarks
64
+ */
65
+ reorder(bookmarkIds: string[], userId: string): Promise<({
66
+ documentId: string;
67
+ id: number;
28
68
  } & {
29
69
  [key: string]: any;
30
70
  })[]>;
71
+ /**
72
+ * Validate URL format
73
+ * @param url - URL to validate
74
+ * @returns True if valid
75
+ */
31
76
  validateUrl(url: string): boolean;
32
77
  };
33
78
  export default bookmarkService;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.3.1",
2
+ "version": "3.0.0",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "strapi-plugin",
@@ -100,10 +100,10 @@
100
100
  "author": "Schero D.",
101
101
  "repository": {
102
102
  "type": "git",
103
- "url": "https://github.com/fame361/Magicmark.git"
103
+ "url": "https://github.com/Schero94/Magicmark.git"
104
104
  },
105
105
  "bugs": {
106
- "url": "https://github.com/fame361/Magicmark/issues"
106
+ "url": "https://github.com/Schero94/Magicmark/issues"
107
107
  },
108
- "homepage": "https://github.com/fame361/Magicmark#readme"
108
+ "homepage": "https://github.com/Schero94/Magicmark#readme"
109
109
  }