@abyss-project/main 1.0.62 → 1.0.64

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.
Files changed (55) hide show
  1. package/dist/api/draw.api.d.ts +8 -0
  2. package/dist/api/draw.api.js +36 -0
  3. package/dist/api/draw.public.api.d.ts +5 -0
  4. package/dist/api/draw.public.api.js +20 -0
  5. package/dist/api/index.d.ts +2 -0
  6. package/dist/api/index.js +2 -0
  7. package/dist/server-sent-events/index.d.ts +5 -0
  8. package/dist/server-sent-events/index.js +7 -0
  9. package/dist/server-sent-events/protocols/board/board.sse-protocol.d.ts +91 -0
  10. package/dist/server-sent-events/protocols/board/board.sse-protocol.js +23 -0
  11. package/dist/server-sent-events/protocols/board/index.d.ts +1 -0
  12. package/dist/server-sent-events/protocols/board/index.js +17 -0
  13. package/dist/server-sent-events/protocols/board-card/board-card.sse-protocol.d.ts +18 -0
  14. package/dist/server-sent-events/protocols/board-card/board-card.sse-protocol.js +11 -0
  15. package/dist/server-sent-events/protocols/board-card/index.d.ts +1 -0
  16. package/dist/server-sent-events/protocols/board-card/index.js +17 -0
  17. package/dist/server-sent-events/protocols/index.d.ts +2 -0
  18. package/dist/server-sent-events/protocols/index.js +2 -0
  19. package/dist/server-sent-events/protocols/user-notification/user-notification.sse-protocol.d.ts +4 -5
  20. package/dist/server-sent-events/protocols/user-notification/user-notification.sse-protocol.js +3 -4
  21. package/dist/server-sent-events/server-sent-events.manager.d.ts +4 -0
  22. package/dist/types/draw.type.d.ts +106 -0
  23. package/dist/types/draw.type.js +14 -0
  24. package/dist/types/enum/abyss-application-event.enum.d.ts +5 -0
  25. package/dist/types/enum/abyss-application-event.enum.js +5 -0
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/index.js +1 -0
  28. package/dist/types/interface/api/index.d.ts +4 -0
  29. package/dist/types/interface/api/index.js +4 -0
  30. package/dist/types/interface/api/requests/board-card.request.d.ts +4 -0
  31. package/dist/types/interface/api/requests/draw.public.request.d.ts +17 -0
  32. package/dist/types/interface/api/requests/draw.public.request.js +2 -0
  33. package/dist/types/interface/api/requests/draw.request.d.ts +31 -0
  34. package/dist/types/interface/api/requests/draw.request.js +2 -0
  35. package/dist/types/interface/api/responses/draw.public.response.d.ts +17 -0
  36. package/dist/types/interface/api/responses/draw.public.response.js +2 -0
  37. package/dist/types/interface/api/responses/draw.response.d.ts +18 -0
  38. package/dist/types/interface/api/responses/draw.response.js +2 -0
  39. package/dist/types/interface/index.d.ts +1 -0
  40. package/dist/types/interface/index.js +1 -0
  41. package/dist/types/interface/models/draw.model.d.ts +20 -0
  42. package/dist/types/interface/models/draw.model.js +2 -0
  43. package/dist/types/interface/models/project.model.d.ts +2 -0
  44. package/dist/types/interface/models/user.model.d.ts +2 -0
  45. package/dist/utils/compression.utils.d.ts +2 -0
  46. package/dist/utils/compression.utils.js +12 -0
  47. package/dist/utils/file.utils.d.ts +1 -0
  48. package/dist/utils/file.utils.js +22 -0
  49. package/dist/utils/icons.utils.d.ts +75 -0
  50. package/dist/utils/icons.utils.js +86 -0
  51. package/dist/utils/index.d.ts +4 -0
  52. package/dist/utils/index.js +4 -0
  53. package/dist/utils/shape.utils.d.ts +22 -0
  54. package/dist/utils/shape.utils.js +181 -0
  55. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { ICreateDrawBody, ICreateDrawResponse, ICreateForProjectDrawParams, IDeleteDrawParams, IDeleteDrawResponse, IGetDrawParams, IGetDrawResponse, IPaginateDrawQuery, IPaginateDrawResponse, IPaginateProjectDrawParams, IUpdateDrawBody, IUpdateDrawParams, IUpdateDrawResponse } from '../types';
2
+ export declare const paginateDraw: (query: IPaginateDrawQuery) => Promise<IPaginateDrawResponse>;
3
+ export declare const paginateProjectDraw: (params: IPaginateProjectDrawParams, query: IPaginateDrawQuery) => Promise<IPaginateDrawResponse>;
4
+ export declare const getDraw: (params: IGetDrawParams) => Promise<IGetDrawResponse>;
5
+ export declare const deleteDraw: (params: IDeleteDrawParams) => Promise<IDeleteDrawResponse>;
6
+ export declare const updateDraw: (params: IUpdateDrawParams, body: IUpdateDrawBody) => Promise<IUpdateDrawResponse>;
7
+ export declare const createDraw: (body: ICreateDrawBody) => Promise<ICreateDrawResponse>;
8
+ export declare const createForProjectDraw: (params: ICreateForProjectDrawParams, body: ICreateDrawBody) => Promise<ICreateDrawResponse>;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createForProjectDraw = exports.createDraw = exports.updateDraw = exports.deleteDraw = exports.getDraw = exports.paginateProjectDraw = exports.paginateDraw = void 0;
4
+ const __1 = require("..");
5
+ const paginateDraw = async (query) => {
6
+ return (await __1.AbyssCore.axios.get(`draw/paginate`, { params: query }))
7
+ .data;
8
+ };
9
+ exports.paginateDraw = paginateDraw;
10
+ const paginateProjectDraw = async (params, query) => {
11
+ return (await __1.AbyssCore.axios.get(`project/${params.projectId}/draw/paginate`, {
12
+ params: query,
13
+ })).data;
14
+ };
15
+ exports.paginateProjectDraw = paginateProjectDraw;
16
+ const getDraw = async (params) => {
17
+ return (await __1.AbyssCore.axios.get(`draw/${params.drawId}`)).data;
18
+ };
19
+ exports.getDraw = getDraw;
20
+ const deleteDraw = async (params) => {
21
+ return (await __1.AbyssCore.axios.delete(`draw/${params.drawId}`)).data;
22
+ };
23
+ exports.deleteDraw = deleteDraw;
24
+ const updateDraw = async (params, body) => {
25
+ return (await __1.AbyssCore.axios.put(`draw/${params.drawId}`, body)).data;
26
+ };
27
+ exports.updateDraw = updateDraw;
28
+ const createDraw = async (body) => {
29
+ return (await __1.AbyssCore.axios.post(`draw`, body)).data;
30
+ };
31
+ exports.createDraw = createDraw;
32
+ const createForProjectDraw = async (params, body) => {
33
+ return (await __1.AbyssCore.axios.post(`draw/project/${params.projectId}`, body))
34
+ .data;
35
+ };
36
+ exports.createForProjectDraw = createForProjectDraw;
@@ -0,0 +1,5 @@
1
+ import { ICreateDrawPublicBody, ICreateDrawPublicResponse, IDeleteDrawPublicParams, IDeleteDrawPublicResponse, IGetDrawPublicParams, IGetDrawPublicResponse, IUpdateDrawPublicBody, IUpdateDrawPublicParams, IUpdateDrawPublicResponse } from '../types';
2
+ export declare const getDrawPublic: (params: IGetDrawPublicParams) => Promise<IGetDrawPublicResponse>;
3
+ export declare const deleteDrawPublic: (params: IDeleteDrawPublicParams) => Promise<IDeleteDrawPublicResponse>;
4
+ export declare const updateDrawPublic: (params: IUpdateDrawPublicParams, body: IUpdateDrawPublicBody) => Promise<IUpdateDrawPublicResponse>;
5
+ export declare const createDrawPublic: (body: ICreateDrawPublicBody) => Promise<ICreateDrawPublicResponse>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createDrawPublic = exports.updateDrawPublic = exports.deleteDrawPublic = exports.getDrawPublic = void 0;
4
+ const __1 = require("..");
5
+ const getDrawPublic = async (params) => {
6
+ return (await __1.AbyssCore.axios.get(`draw/public/${params.publicAccessToken}`)).data;
7
+ };
8
+ exports.getDrawPublic = getDrawPublic;
9
+ const deleteDrawPublic = async (params) => {
10
+ return (await __1.AbyssCore.axios.delete(`draw/public/${params.publicAccessToken}`)).data;
11
+ };
12
+ exports.deleteDrawPublic = deleteDrawPublic;
13
+ const updateDrawPublic = async (params, body) => {
14
+ return (await __1.AbyssCore.axios.put(`draw/public/${params.publicAccessToken}`, body)).data;
15
+ };
16
+ exports.updateDrawPublic = updateDrawPublic;
17
+ const createDrawPublic = async (body) => {
18
+ return (await __1.AbyssCore.axios.post(`draw/public`, body)).data;
19
+ };
20
+ exports.createDrawPublic = createDrawPublic;
@@ -29,3 +29,5 @@ export * from './board-label.api';
29
29
  export * from './board-card-comment.api';
30
30
  export * from './board-card-checklist.api';
31
31
  export * from './board-card-document.api';
32
+ export * from './draw.api';
33
+ export * from './draw.public.api';
package/dist/api/index.js CHANGED
@@ -45,3 +45,5 @@ __exportStar(require("./board-label.api"), exports);
45
45
  __exportStar(require("./board-card-comment.api"), exports);
46
46
  __exportStar(require("./board-card-checklist.api"), exports);
47
47
  __exportStar(require("./board-card-document.api"), exports);
48
+ __exportStar(require("./draw.api"), exports);
49
+ __exportStar(require("./draw.public.api"), exports);
@@ -1,2 +1,7 @@
1
1
  export * from './server-sent-events.manager';
2
2
  export * from './protocols';
3
+ export declare enum SSEChannels {
4
+ BOARD = "sse:board",
5
+ BOARD_CARD = "sse:board-card",
6
+ USER_NOTIFICATION = "sse:user-notification"
7
+ }
@@ -14,5 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SSEChannels = void 0;
17
18
  __exportStar(require("./server-sent-events.manager"), exports);
18
19
  __exportStar(require("./protocols"), exports);
20
+ var SSEChannels;
21
+ (function (SSEChannels) {
22
+ SSEChannels["BOARD"] = "sse:board";
23
+ SSEChannels["BOARD_CARD"] = "sse:board-card";
24
+ SSEChannels["USER_NOTIFICATION"] = "sse:user-notification";
25
+ })(SSEChannels || (exports.SSEChannels = SSEChannels = {}));
@@ -0,0 +1,91 @@
1
+ import { SystemSSEMessageContent } from '..';
2
+ import { IBoardCardChecklist, IBoardCardComment, IBoardCardDocument, IBoardCardMember, IGetBoardData, IListBoardLabelData, ValueOf } from '../../../types';
3
+ export declare enum BoardSSEEvent {
4
+ BOARD_UPDATE = "BOARD_UPDATE",
5
+ BOARD_DELETE = "BOARD_DELETE",
6
+ BOARD_LABELS = "BOARD_LABELS",
7
+ BOARD_CARD_MEMBER_CREATE = "BOARD_CARD_MEMBER_CREATE",
8
+ BOARD_CARD_MEMBER_DELETE = "BOARD_CARD_MEMBER_DELETE",
9
+ BOARD_CARD_DOCUMENT_CREATE = "BOARD_CARD_DOCUMENT_CREATE",
10
+ BOARD_CARD_DOCUMENT_DELETE = "BOARD_CARD_DOCUMENT_DELETE",
11
+ BOARD_CARD_COMMENT_CREATE = "BOARD_CARD_COMMENT_CREATE",
12
+ BOARD_CARD_COMMENT_DELETE = "BOARD_CARD_COMMENT_DELETE",
13
+ BOARD_CARD_COMMENT_UPDATE = "BOARD_CARD_COMMENT_UPDATE",
14
+ BOARD_CARD_CHECKLIST_CREATE = "BOARD_CARD_CHECKLIST_CREATE",
15
+ BOARD_CARD_CHECKLIST_DELETE = "BOARD_CARD_CHECKLIST_DELETE",
16
+ BOARD_CARD_CHECKLIST_UPDATE = "BOARD_CARD_CHECKLIST_UPDATE"
17
+ }
18
+ export type BoardSSEMessageContent = ValueOf<{
19
+ [K in BoardSSEEvent]: {
20
+ type: K;
21
+ payload: SourceBoardSSEEventPayload[K];
22
+ };
23
+ }>;
24
+ export declare class SourceBoardSSEEventPayload implements Record<BoardSSEEvent, Record<string, any>> {
25
+ [BoardSSEEvent.BOARD_UPDATE]: {
26
+ boardId: string;
27
+ boardData: IGetBoardData;
28
+ };
29
+ [BoardSSEEvent.BOARD_DELETE]: {
30
+ boardId: string;
31
+ };
32
+ [BoardSSEEvent.BOARD_LABELS]: {
33
+ boardId: string;
34
+ boardLabels: IListBoardLabelData['boardLabels'];
35
+ };
36
+ [BoardSSEEvent.BOARD_CARD_MEMBER_CREATE]: {
37
+ boardId: string;
38
+ boardCardMember: IBoardCardMember;
39
+ boardData: IGetBoardData;
40
+ };
41
+ [BoardSSEEvent.BOARD_CARD_MEMBER_DELETE]: {
42
+ boardId: string;
43
+ boardCardId: string;
44
+ userId: string;
45
+ boardData: IGetBoardData;
46
+ };
47
+ [BoardSSEEvent.BOARD_CARD_DOCUMENT_CREATE]: {
48
+ boardId: string;
49
+ boardCardDocument: IBoardCardDocument;
50
+ boardData: IGetBoardData;
51
+ };
52
+ [BoardSSEEvent.BOARD_CARD_DOCUMENT_DELETE]: {
53
+ boardId: string;
54
+ boardCardId: string;
55
+ boardCardDocumentId: string;
56
+ boardData: IGetBoardData;
57
+ };
58
+ [BoardSSEEvent.BOARD_CARD_COMMENT_CREATE]: {
59
+ boardId: string;
60
+ boardCardComment: IBoardCardComment;
61
+ boardData: IGetBoardData;
62
+ };
63
+ [BoardSSEEvent.BOARD_CARD_COMMENT_DELETE]: {
64
+ boardId: string;
65
+ boardCardId: string;
66
+ boardCardCommentId: string;
67
+ boardData: IGetBoardData;
68
+ };
69
+ [BoardSSEEvent.BOARD_CARD_COMMENT_UPDATE]: {
70
+ boardId: string;
71
+ boardCardComment: IBoardCardComment;
72
+ boardData: IGetBoardData;
73
+ };
74
+ [BoardSSEEvent.BOARD_CARD_CHECKLIST_CREATE]: {
75
+ boardId: string;
76
+ boardCardChecklist: IBoardCardChecklist;
77
+ boardData: IGetBoardData;
78
+ };
79
+ [BoardSSEEvent.BOARD_CARD_CHECKLIST_DELETE]: {
80
+ boardId: string;
81
+ boardCardId: string;
82
+ boardCardChecklistId: string;
83
+ boardData: IGetBoardData;
84
+ };
85
+ [BoardSSEEvent.BOARD_CARD_CHECKLIST_UPDATE]: {
86
+ boardId: string;
87
+ boardCardChecklist: IBoardCardChecklist;
88
+ boardData: IGetBoardData;
89
+ };
90
+ }
91
+ export type BoardSSEEventContent = BoardSSEMessageContent | SystemSSEMessageContent;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SourceBoardSSEEventPayload = exports.BoardSSEEvent = void 0;
4
+ var BoardSSEEvent;
5
+ (function (BoardSSEEvent) {
6
+ BoardSSEEvent["BOARD_UPDATE"] = "BOARD_UPDATE";
7
+ BoardSSEEvent["BOARD_DELETE"] = "BOARD_DELETE";
8
+ BoardSSEEvent["BOARD_LABELS"] = "BOARD_LABELS";
9
+ BoardSSEEvent["BOARD_CARD_MEMBER_CREATE"] = "BOARD_CARD_MEMBER_CREATE";
10
+ BoardSSEEvent["BOARD_CARD_MEMBER_DELETE"] = "BOARD_CARD_MEMBER_DELETE";
11
+ BoardSSEEvent["BOARD_CARD_DOCUMENT_CREATE"] = "BOARD_CARD_DOCUMENT_CREATE";
12
+ BoardSSEEvent["BOARD_CARD_DOCUMENT_DELETE"] = "BOARD_CARD_DOCUMENT_DELETE";
13
+ BoardSSEEvent["BOARD_CARD_COMMENT_CREATE"] = "BOARD_CARD_COMMENT_CREATE";
14
+ BoardSSEEvent["BOARD_CARD_COMMENT_DELETE"] = "BOARD_CARD_COMMENT_DELETE";
15
+ BoardSSEEvent["BOARD_CARD_COMMENT_UPDATE"] = "BOARD_CARD_COMMENT_UPDATE";
16
+ BoardSSEEvent["BOARD_CARD_CHECKLIST_CREATE"] = "BOARD_CARD_CHECKLIST_CREATE";
17
+ BoardSSEEvent["BOARD_CARD_CHECKLIST_DELETE"] = "BOARD_CARD_CHECKLIST_DELETE";
18
+ BoardSSEEvent["BOARD_CARD_CHECKLIST_UPDATE"] = "BOARD_CARD_CHECKLIST_UPDATE";
19
+ })(BoardSSEEvent || (exports.BoardSSEEvent = BoardSSEEvent = {}));
20
+ class SourceBoardSSEEventPayload {
21
+ }
22
+ exports.SourceBoardSSEEventPayload = SourceBoardSSEEventPayload;
23
+ BoardSSEEvent.BOARD_UPDATE, BoardSSEEvent.BOARD_DELETE, BoardSSEEvent.BOARD_LABELS, BoardSSEEvent.BOARD_CARD_MEMBER_CREATE, BoardSSEEvent.BOARD_CARD_MEMBER_DELETE, BoardSSEEvent.BOARD_CARD_DOCUMENT_CREATE, BoardSSEEvent.BOARD_CARD_DOCUMENT_DELETE, BoardSSEEvent.BOARD_CARD_COMMENT_CREATE, BoardSSEEvent.BOARD_CARD_COMMENT_DELETE, BoardSSEEvent.BOARD_CARD_COMMENT_UPDATE, BoardSSEEvent.BOARD_CARD_CHECKLIST_CREATE, BoardSSEEvent.BOARD_CARD_CHECKLIST_DELETE, BoardSSEEvent.BOARD_CARD_CHECKLIST_UPDATE;
@@ -0,0 +1 @@
1
+ export * from './board.sse-protocol';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./board.sse-protocol"), exports);
@@ -0,0 +1,18 @@
1
+ import { SystemSSEMessageContent } from '..';
2
+ import { IGetBoardCardData, ValueOf } from '../../../types';
3
+ export declare enum BoardCardSSEEvent {
4
+ BOARD_CARD_UPDATE = "BOARD_CARD_UPDATE"
5
+ }
6
+ export type BoardCardSSEMessageContent = ValueOf<{
7
+ [K in BoardCardSSEEvent]: {
8
+ type: K;
9
+ payload: SourceBoardCardSSEEventPayload[K];
10
+ };
11
+ }>;
12
+ export declare class SourceBoardCardSSEEventPayload implements Record<BoardCardSSEEvent, Record<string, any>> {
13
+ [BoardCardSSEEvent.BOARD_CARD_UPDATE]: {
14
+ boardCardId: string;
15
+ boardData: IGetBoardCardData;
16
+ };
17
+ }
18
+ export type BoardCardSSEEventContent = BoardCardSSEMessageContent | SystemSSEMessageContent;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SourceBoardCardSSEEventPayload = exports.BoardCardSSEEvent = void 0;
4
+ var BoardCardSSEEvent;
5
+ (function (BoardCardSSEEvent) {
6
+ BoardCardSSEEvent["BOARD_CARD_UPDATE"] = "BOARD_CARD_UPDATE";
7
+ })(BoardCardSSEEvent || (exports.BoardCardSSEEvent = BoardCardSSEEvent = {}));
8
+ class SourceBoardCardSSEEventPayload {
9
+ }
10
+ exports.SourceBoardCardSSEEventPayload = SourceBoardCardSSEEventPayload;
11
+ BoardCardSSEEvent.BOARD_CARD_UPDATE;
@@ -0,0 +1 @@
1
+ export * from './board-card.sse-protocol';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./board-card.sse-protocol"), exports);
@@ -1,5 +1,7 @@
1
1
  import { ValueOf } from '../..';
2
2
  export * from './user-notification';
3
+ export * from './board';
4
+ export * from './board-card';
3
5
  export declare enum SYSTEM_PROTOCOL_EVENTS {
4
6
  PING = "PING"
5
7
  }
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SystemSSEEventPayload = exports.SYSTEM_PROTOCOL_EVENTS = void 0;
18
18
  __exportStar(require("./user-notification"), exports);
19
+ __exportStar(require("./board"), exports);
20
+ __exportStar(require("./board-card"), exports);
19
21
  var SYSTEM_PROTOCOL_EVENTS;
20
22
  (function (SYSTEM_PROTOCOL_EVENTS) {
21
23
  SYSTEM_PROTOCOL_EVENTS["PING"] = "PING";
@@ -1,6 +1,5 @@
1
- import { SystemSSEEventPayload } from '..';
1
+ import { SystemSSEMessageContent } from '..';
2
2
  import { IUserNotification, NotificationDTO, ValueOf } from '../../../types';
3
- export declare const SSE_USER_NOTIFICATION_CHANNEL = "SSE_USER_NOTIFICATION_CHANNEL";
4
3
  export declare enum UserNotificationSSEEvent {
5
4
  USER_NOTIFICATION_CREATED = "USER_NOTIFICATION_CREATED",
6
5
  USER_NOTIFICATION_OPENED = "USER_NOTIFICATION_OPENED"
@@ -8,10 +7,10 @@ export declare enum UserNotificationSSEEvent {
8
7
  export type UserNotificationSSEMessageContent = ValueOf<{
9
8
  [K in UserNotificationSSEEvent]: {
10
9
  type: K;
11
- payload: UserNotificationSSEEventPayload[K];
10
+ payload: SourceUserNotificationSSEEventPayload[K];
12
11
  };
13
12
  }>;
14
- export declare class UserNotificationSSEEventPayload implements Record<UserNotificationSSEEvent, Record<string, any>> {
13
+ export declare class SourceUserNotificationSSEEventPayload implements Record<UserNotificationSSEEvent, Record<string, any>> {
15
14
  [UserNotificationSSEEvent.USER_NOTIFICATION_CREATED]: {
16
15
  userNotification: IUserNotification & NotificationDTO;
17
16
  userId: string;
@@ -21,4 +20,4 @@ export declare class UserNotificationSSEEventPayload implements Record<UserNotif
21
20
  userId: string;
22
21
  };
23
22
  }
24
- export type UserNotificationCombinedSSEEventPayload = UserNotificationSSEEventPayload & SystemSSEEventPayload;
23
+ export type UserNotificationSSEEventContent = UserNotificationSSEMessageContent | SystemSSEMessageContent;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserNotificationSSEEventPayload = exports.UserNotificationSSEEvent = exports.SSE_USER_NOTIFICATION_CHANNEL = void 0;
4
- exports.SSE_USER_NOTIFICATION_CHANNEL = 'SSE_USER_NOTIFICATION_CHANNEL';
3
+ exports.SourceUserNotificationSSEEventPayload = exports.UserNotificationSSEEvent = void 0;
5
4
  var UserNotificationSSEEvent;
6
5
  (function (UserNotificationSSEEvent) {
7
6
  UserNotificationSSEEvent["USER_NOTIFICATION_CREATED"] = "USER_NOTIFICATION_CREATED";
8
7
  UserNotificationSSEEvent["USER_NOTIFICATION_OPENED"] = "USER_NOTIFICATION_OPENED";
9
8
  })(UserNotificationSSEEvent || (exports.UserNotificationSSEEvent = UserNotificationSSEEvent = {}));
10
- class UserNotificationSSEEventPayload {
9
+ class SourceUserNotificationSSEEventPayload {
11
10
  }
12
- exports.UserNotificationSSEEventPayload = UserNotificationSSEEventPayload;
11
+ exports.SourceUserNotificationSSEEventPayload = SourceUserNotificationSSEEventPayload;
13
12
  UserNotificationSSEEvent.USER_NOTIFICATION_CREATED, UserNotificationSSEEvent.USER_NOTIFICATION_OPENED;
@@ -5,6 +5,10 @@ export declare class ServerSentEventBaseContext {
5
5
  req: Request;
6
6
  res: Response;
7
7
  }
8
+ export type RedisSSEMessage = {
9
+ key: string;
10
+ data: any;
11
+ };
8
12
  export declare class ServerSentEventsManager<T extends ServerSentEventBaseContext, P extends {
9
13
  type: string;
10
14
  payload: any;
@@ -0,0 +1,106 @@
1
+ import { Endpoint, ICON_LIBRARY } from '../utils';
2
+ export type DrawData = {
3
+ drawId: string | null;
4
+ shapes: DrawShapeToJsonResult[];
5
+ stagePos: Point;
6
+ stageScale: number;
7
+ showGrid: boolean;
8
+ timestamp: number;
9
+ version: number;
10
+ };
11
+ export interface Point {
12
+ x: number;
13
+ y: number;
14
+ }
15
+ export interface BoundingBox {
16
+ x1: number;
17
+ y1: number;
18
+ x2: number;
19
+ y2: number;
20
+ }
21
+ export interface DrawSize {
22
+ width: number;
23
+ height: number;
24
+ }
25
+ export interface DrawStyle {
26
+ fillColor: string;
27
+ strokeColor: string;
28
+ strokeWidth: number;
29
+ opacity: number;
30
+ lineDash: number[];
31
+ cornerRadius: number;
32
+ fontSize: number;
33
+ fontFamily: string;
34
+ preserveAspectRatio: boolean;
35
+ rotation: number;
36
+ }
37
+ export interface ShapeProperties {
38
+ position: Point;
39
+ zIndex?: number;
40
+ size: DrawSize;
41
+ style?: Partial<DrawStyle>;
42
+ }
43
+ export declare enum DrawShapeType {
44
+ RECTANGLE = "RECTANGLE",
45
+ DIAMOND = "DIAMOND",
46
+ ELLIPSE = "ELLIPSE",
47
+ TEXT = "TEXT",
48
+ ICON = "ICON",
49
+ IMAGE = "IMAGE",
50
+ COMMENT = "COMMENT",
51
+ ARROW = "ARROW"
52
+ }
53
+ export type ResizeShape = {
54
+ corner: 'se' | 'sw' | 'ne' | 'nw';
55
+ startPos: Point;
56
+ originalSize: DrawSize;
57
+ originalPosition: Point;
58
+ };
59
+ export type RotationData = {
60
+ startAngle: number;
61
+ originalRotation: number;
62
+ center: Point;
63
+ };
64
+ export type Id = string;
65
+ export type PortId = 'top' | 'right' | 'bottom' | 'left' | 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
66
+ export type DrawShapeToJsonBaseResult = {
67
+ id: string;
68
+ type: DrawShapeType;
69
+ position: Point;
70
+ size: DrawSize;
71
+ style: DrawStyle;
72
+ zIndex: number;
73
+ };
74
+ export type DrawShapeArrowToJsonResult = DrawShapeToJsonBaseResult & {
75
+ type: DrawShapeType.ARROW;
76
+ startEndpoint: Endpoint;
77
+ endEndpoint: Endpoint;
78
+ };
79
+ export type DrawShapeIconToJsonResult = DrawShapeToJsonBaseResult & {
80
+ type: DrawShapeType.ICON;
81
+ iconType: keyof typeof ICON_LIBRARY;
82
+ };
83
+ export type DrawShapeTextToJsonResult = DrawShapeToJsonBaseResult & {
84
+ type: DrawShapeType.TEXT;
85
+ text: string;
86
+ };
87
+ export type DrawShapeRectangleToJsonResult = {
88
+ type: DrawShapeType.RECTANGLE;
89
+ } & DrawShapeToJsonBaseResult;
90
+ export type DrawShapeDiamondToJsonResult = {
91
+ type: DrawShapeType.DIAMOND;
92
+ } & DrawShapeToJsonBaseResult;
93
+ export type DrawShapeImageToJsonResult = DrawShapeToJsonBaseResult & {
94
+ type: DrawShapeType.IMAGE;
95
+ src: string;
96
+ base64: string;
97
+ };
98
+ export type DrawShapeEllipseToJsonResult = DrawShapeToJsonBaseResult & {
99
+ type: DrawShapeType.ELLIPSE;
100
+ };
101
+ export type DrawShapeCommentToJsonResult = DrawShapeToJsonBaseResult & {
102
+ type: DrawShapeType.COMMENT;
103
+ text: string;
104
+ date: string;
105
+ };
106
+ export type DrawShapeToJsonResult = DrawShapeArrowToJsonResult | DrawShapeIconToJsonResult | DrawShapeTextToJsonResult | DrawShapeRectangleToJsonResult | DrawShapeDiamondToJsonResult | DrawShapeImageToJsonResult | DrawShapeCommentToJsonResult | DrawShapeEllipseToJsonResult;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DrawShapeType = void 0;
4
+ var DrawShapeType;
5
+ (function (DrawShapeType) {
6
+ DrawShapeType["RECTANGLE"] = "RECTANGLE";
7
+ DrawShapeType["DIAMOND"] = "DIAMOND";
8
+ DrawShapeType["ELLIPSE"] = "ELLIPSE";
9
+ DrawShapeType["TEXT"] = "TEXT";
10
+ DrawShapeType["ICON"] = "ICON";
11
+ DrawShapeType["IMAGE"] = "IMAGE";
12
+ DrawShapeType["COMMENT"] = "COMMENT";
13
+ DrawShapeType["ARROW"] = "ARROW";
14
+ })(DrawShapeType || (exports.DrawShapeType = DrawShapeType = {}));
@@ -8,6 +8,8 @@ export declare enum AbyssApplicationEvent {
8
8
  USER_NOTIFICATION_OPEN = "user.notification.open",
9
9
  SERVER_SENT_EVENTS_BOARD_OPEN = "server-sent-events.board.open",
10
10
  SERVER_SENT_EVENTS_BOARD_SEND = "server-sent-events.board.send",
11
+ SERVER_SENT_EVENTS_BOARD_CARD_OPEN = "server-sent-events.board-card.open",
12
+ SERVER_SENT_EVENTS_BOARD_CARD_SEND = "server-sent-events.board-card.send",
11
13
  SERVER_SENT_EVENTS_USER_OPEN = "server-sent-events.user.open",
12
14
  SERVER_SENT_EVENTS_USER_SEND = "server-sent-events.user.send",
13
15
  BOARD_CREATE = "board.create",
@@ -38,6 +40,9 @@ export declare enum AbyssApplicationEvent {
38
40
  BOARD_CARD_COMMENT_CREATE = "board.card.comment.create",
39
41
  BOARD_CARD_COMMENT_UPDATE = "board.card.comment.update",
40
42
  BOARD_CARD_COMMENT_DELETE = "board.card.comment.delete",
43
+ DRAW_CREATE = "draw.create",
44
+ DRAW_UPDATE = "draw.update",
45
+ DRAW_DELETE = "draw.delete",
41
46
  ABYSS_STORAGE_MINDEE_EXTRACT = "abyss-storage.mindee.extract",
42
47
  ABYSS_STORAGE_COLLECTION_FREEPIK_FETCH = "abyss-storage.collection.freepik.fetch",
43
48
  ABYSS_STORAGE_COLLECTION_FREEPIK_GET_DOWNLOAD_URL = "abyss-storage.collection.freepik.get-download-url",
@@ -12,6 +12,8 @@ var AbyssApplicationEvent;
12
12
  AbyssApplicationEvent["USER_NOTIFICATION_OPEN"] = "user.notification.open";
13
13
  AbyssApplicationEvent["SERVER_SENT_EVENTS_BOARD_OPEN"] = "server-sent-events.board.open";
14
14
  AbyssApplicationEvent["SERVER_SENT_EVENTS_BOARD_SEND"] = "server-sent-events.board.send";
15
+ AbyssApplicationEvent["SERVER_SENT_EVENTS_BOARD_CARD_OPEN"] = "server-sent-events.board-card.open";
16
+ AbyssApplicationEvent["SERVER_SENT_EVENTS_BOARD_CARD_SEND"] = "server-sent-events.board-card.send";
15
17
  AbyssApplicationEvent["SERVER_SENT_EVENTS_USER_OPEN"] = "server-sent-events.user.open";
16
18
  AbyssApplicationEvent["SERVER_SENT_EVENTS_USER_SEND"] = "server-sent-events.user.send";
17
19
  AbyssApplicationEvent["BOARD_CREATE"] = "board.create";
@@ -42,6 +44,9 @@ var AbyssApplicationEvent;
42
44
  AbyssApplicationEvent["BOARD_CARD_COMMENT_CREATE"] = "board.card.comment.create";
43
45
  AbyssApplicationEvent["BOARD_CARD_COMMENT_UPDATE"] = "board.card.comment.update";
44
46
  AbyssApplicationEvent["BOARD_CARD_COMMENT_DELETE"] = "board.card.comment.delete";
47
+ AbyssApplicationEvent["DRAW_CREATE"] = "draw.create";
48
+ AbyssApplicationEvent["DRAW_UPDATE"] = "draw.update";
49
+ AbyssApplicationEvent["DRAW_DELETE"] = "draw.delete";
45
50
  AbyssApplicationEvent["ABYSS_STORAGE_MINDEE_EXTRACT"] = "abyss-storage.mindee.extract";
46
51
  AbyssApplicationEvent["ABYSS_STORAGE_COLLECTION_FREEPIK_FETCH"] = "abyss-storage.collection.freepik.fetch";
47
52
  AbyssApplicationEvent["ABYSS_STORAGE_COLLECTION_FREEPIK_GET_DOWNLOAD_URL"] = "abyss-storage.collection.freepik.get-download-url";
@@ -7,3 +7,4 @@ export type BaseEntity<T> = Omit<T, 'createdAt' | 'deletedAt' | 'updatedAt'>;
7
7
  export type WithRequired<T, K extends keyof T> = T & {
8
8
  [P in K]-?: T[P];
9
9
  };
10
+ export * from './draw.type';
@@ -19,3 +19,4 @@ __exportStar(require("./enum"), exports);
19
19
  __exportStar(require("./session"), exports);
20
20
  __exportStar(require("./utils"), exports);
21
21
  __exportStar(require("./models"), exports);
22
+ __exportStar(require("./draw.type"), exports);
@@ -31,6 +31,8 @@ export * from './requests/board-label.request';
31
31
  export * from './requests/board-card-comment.request';
32
32
  export * from './requests/board-card-checklist.request';
33
33
  export * from './requests/board-card-document.request';
34
+ export * from './requests/draw.request';
35
+ export * from './requests/draw.public.request';
34
36
  export * from './responses/auth.response';
35
37
  export * from './responses/user.response';
36
38
  export * from './responses/user.admin.response';
@@ -62,3 +64,5 @@ export * from './responses/board-label.response';
62
64
  export * from './responses/board-card-comment.response';
63
65
  export * from './responses/board-card-checklist.response';
64
66
  export * from './responses/board-card-document.response';
67
+ export * from './responses/draw.response';
68
+ export * from './responses/draw.public.response';
@@ -47,6 +47,8 @@ __exportStar(require("./requests/board-label.request"), exports);
47
47
  __exportStar(require("./requests/board-card-comment.request"), exports);
48
48
  __exportStar(require("./requests/board-card-checklist.request"), exports);
49
49
  __exportStar(require("./requests/board-card-document.request"), exports);
50
+ __exportStar(require("./requests/draw.request"), exports);
51
+ __exportStar(require("./requests/draw.public.request"), exports);
50
52
  __exportStar(require("./responses/auth.response"), exports);
51
53
  __exportStar(require("./responses/user.response"), exports);
52
54
  __exportStar(require("./responses/user.admin.response"), exports);
@@ -78,3 +80,5 @@ __exportStar(require("./responses/board-label.response"), exports);
78
80
  __exportStar(require("./responses/board-card-comment.response"), exports);
79
81
  __exportStar(require("./responses/board-card-checklist.response"), exports);
80
82
  __exportStar(require("./responses/board-card-document.response"), exports);
83
+ __exportStar(require("./responses/draw.response"), exports);
84
+ __exportStar(require("./responses/draw.public.response"), exports);
@@ -28,6 +28,10 @@ export type IGetBoardCardParams = {
28
28
  boardId: string;
29
29
  boardCardId: string;
30
30
  };
31
+ export type ISSEBoardCardParams = {
32
+ boardId: string;
33
+ boardCardId: string;
34
+ };
31
35
  export type IDeleteBoardCardParams = {
32
36
  boardId: string;
33
37
  boardCardId: string;
@@ -0,0 +1,17 @@
1
+ export type ICreateDrawPublicBody = {
2
+ title: string;
3
+ content: string;
4
+ };
5
+ export type IUpdateDrawPublicParams = {
6
+ publicAccessToken: string;
7
+ };
8
+ export type IUpdateDrawPublicBody = {
9
+ title?: string;
10
+ content?: string;
11
+ };
12
+ export type IGetDrawPublicParams = {
13
+ publicAccessToken: string;
14
+ };
15
+ export type IDeleteDrawPublicParams = {
16
+ publicAccessToken: string;
17
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ import { QueryPaginate } from '../type-message/base-paginate';
2
+ export type ICreateForProjectDrawParams = {
3
+ projectId: string;
4
+ };
5
+ export type ICreateDrawBody = {
6
+ title: string;
7
+ content: string;
8
+ };
9
+ export type IUpdateDrawParams = {
10
+ drawId: string;
11
+ };
12
+ export type IUpdateDrawBody = {
13
+ title?: string;
14
+ archived?: boolean;
15
+ content?: string;
16
+ enablePublicReadAccess?: boolean;
17
+ enablePublicWriteAccess?: boolean;
18
+ };
19
+ export type IGetDrawParams = {
20
+ drawId: string;
21
+ };
22
+ export type IDeleteDrawParams = {
23
+ drawId: string;
24
+ };
25
+ export type IPaginateDrawQuery = {
26
+ title?: string;
27
+ archived?: boolean;
28
+ } & QueryPaginate;
29
+ export type IPaginateProjectDrawParams = {
30
+ projectId: string;
31
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { IResponse } from '..';
2
+ import { IDraw } from '../../models/draw.model';
3
+ export interface IGetDrawPublicData {
4
+ draw: IDraw;
5
+ }
6
+ export type IGetDrawPublicResponse = IResponse<IGetDrawPublicData>;
7
+ export interface IUpdateDrawPublicData {
8
+ draw: IDraw;
9
+ }
10
+ export type IUpdateDrawPublicResponse = IResponse<IUpdateDrawPublicData>;
11
+ export interface ICreateDrawPublicData {
12
+ draw: IDraw;
13
+ }
14
+ export type ICreateDrawPublicResponse = IResponse<ICreateDrawPublicData>;
15
+ export interface IDeleteDrawPublicData {
16
+ }
17
+ export type IDeleteDrawPublicResponse = IResponse<IDeleteDrawPublicData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { BasePaginate, IResponse } from '..';
2
+ import { IDraw } from '../../models/draw.model';
3
+ export interface IGetDrawData {
4
+ draw: IDraw;
5
+ }
6
+ export type IGetDrawResponse = IResponse<IGetDrawData>;
7
+ export interface IUpdateDrawData {
8
+ draw: IDraw;
9
+ }
10
+ export type IUpdateDrawResponse = IResponse<IUpdateDrawData>;
11
+ export interface ICreateDrawData {
12
+ draw: IDraw;
13
+ }
14
+ export type ICreateDrawResponse = IResponse<ICreateDrawData>;
15
+ export interface IDeleteDrawData {
16
+ }
17
+ export type IDeleteDrawResponse = IResponse<IDeleteDrawData>;
18
+ export type IPaginateDrawResponse = IResponse<BasePaginate<IDraw>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -30,3 +30,4 @@ export * from './models/board-card-checklist-row.model';
30
30
  export * from './models/board-card-comment.model';
31
31
  export * from './models/board-label.model';
32
32
  export * from './models/board-card-label.model';
33
+ export * from './models/draw.model';
@@ -46,3 +46,4 @@ __exportStar(require("./models/board-card-checklist-row.model"), exports);
46
46
  __exportStar(require("./models/board-card-comment.model"), exports);
47
47
  __exportStar(require("./models/board-label.model"), exports);
48
48
  __exportStar(require("./models/board-card-label.model"), exports);
49
+ __exportStar(require("./models/draw.model"), exports);
@@ -0,0 +1,20 @@
1
+ import { IProject } from './project.model';
2
+ import { IUser } from './user.model';
3
+ export interface IDraw {
4
+ id: string;
5
+ title: string;
6
+ content: string;
7
+ userId: string | null;
8
+ projectId: string | null;
9
+ publicReadAccess: string | null;
10
+ publicWriteAccess: string | null;
11
+ fileId: string | null;
12
+ filePublicAccessId: string | null;
13
+ thumbnailId: string | null;
14
+ thumbnailPublicAccessId: string | null;
15
+ archivedAt?: Date | null;
16
+ updatedAt?: Date;
17
+ createdAt?: Date;
18
+ user?: IUser | null;
19
+ project?: IProject | null;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ import { IApplication } from './application.model';
5
5
  import { ISubscription } from './subscription.model';
6
6
  import { IUserTransaction } from './user-transaction.model';
7
7
  import { ProjectStatus } from '../../enum';
8
+ import { IDraw } from './draw.model';
8
9
  export interface IProject {
9
10
  id?: string;
10
11
  name: string;
@@ -21,4 +22,5 @@ export interface IProject {
21
22
  application?: IApplication[];
22
23
  subscription?: ISubscription | null;
23
24
  userTransaction?: IUserTransaction[];
25
+ draw?: IDraw[];
24
26
  }
@@ -2,6 +2,7 @@ import { IBoard, IGiftCodeActivation, IOAuthAccount, IProject, IUserTransaction
2
2
  import { AbyssService, OnboardingSteps, UserCreditPurchaseCurrency, UserLanguage, UserType } from '../../enum';
3
3
  import { OnboardingData } from '../../utils';
4
4
  import { IBoardCardComment } from './board-card-comment.model';
5
+ import { IDraw } from './draw.model';
5
6
  import { ISubscription } from './subscription.model';
6
7
  import { IUserNotification } from './user-notification.model';
7
8
  export interface IUserSetting {
@@ -41,6 +42,7 @@ export interface IUser {
41
42
  project?: IProject[];
42
43
  boardCardComment?: IBoardCardComment[];
43
44
  board?: IBoard[];
45
+ draw?: IDraw[];
44
46
  }
45
47
  export type UserOnboardingStatus = {
46
48
  completedAt?: Date | null;
@@ -0,0 +1,2 @@
1
+ export declare const compress: (input: string) => string;
2
+ export declare const decompress: (input: string) => string;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decompress = exports.compress = void 0;
4
+ const lz_string_1 = require("lz-string");
5
+ const compress = (input) => {
6
+ return (0, lz_string_1.compressToBase64)(input);
7
+ };
8
+ exports.compress = compress;
9
+ const decompress = (input) => {
10
+ return (0, lz_string_1.decompressFromBase64)(input);
11
+ };
12
+ exports.decompress = decompress;
@@ -0,0 +1 @@
1
+ export declare const srcToBase64: (src: string) => Promise<string>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.srcToBase64 = void 0;
4
+ const srcToBase64 = (src) => {
5
+ return new Promise((resolve, reject) => {
6
+ const img = new Image();
7
+ img.src = src;
8
+ img.onload = () => {
9
+ const canvas = document.createElement('canvas');
10
+ canvas.width = img.width;
11
+ canvas.height = img.height;
12
+ const ctx = canvas.getContext('2d');
13
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(img, 0, 0);
14
+ const dataURL = canvas.toDataURL('image/png');
15
+ resolve(dataURL);
16
+ };
17
+ img.onerror = (error) => {
18
+ reject(error);
19
+ };
20
+ });
21
+ };
22
+ exports.srcToBase64 = srcToBase64;
@@ -0,0 +1,75 @@
1
+ export declare const ICON_LIBRARY: {
2
+ database: string;
3
+ server: string;
4
+ cloud: string;
5
+ network: string;
6
+ router: string;
7
+ security: string;
8
+ warning: string;
9
+ error: string;
10
+ success: string;
11
+ info: string;
12
+ diamond: string;
13
+ gear: string;
14
+ tool: string;
15
+ wrench: string;
16
+ arrowUp: string;
17
+ arrowDown: string;
18
+ arrowLeft: string;
19
+ arrowRight: string;
20
+ arrowUpRight: string;
21
+ arrowDownRight: string;
22
+ arrowDownLeft: string;
23
+ arrowUpLeft: string;
24
+ start: string;
25
+ stop: string;
26
+ pause: string;
27
+ play: string;
28
+ process: string;
29
+ email: string;
30
+ phone: string;
31
+ message: string;
32
+ notification: string;
33
+ document: string;
34
+ folder: string;
35
+ file: string;
36
+ pdf: string;
37
+ image: string;
38
+ user: string;
39
+ users: string;
40
+ team: string;
41
+ admin: string;
42
+ add: string;
43
+ remove: string;
44
+ edit: string;
45
+ search: string;
46
+ filter: string;
47
+ sort: string;
48
+ online: string;
49
+ offline: string;
50
+ pending: string;
51
+ unknown: string;
52
+ circle: string;
53
+ square: string;
54
+ triangle: string;
55
+ star: string;
56
+ heart: string;
57
+ settings: string;
58
+ power: string;
59
+ battery: string;
60
+ wifi: string;
61
+ bluetooth: string;
62
+ };
63
+ export declare const ICON_CATEGORIES: {
64
+ technical: string[];
65
+ status: string[];
66
+ arrows: string[];
67
+ process: string[];
68
+ communication: string[];
69
+ files: string[];
70
+ users: string[];
71
+ actions: string[];
72
+ shapes: string[];
73
+ system: string[];
74
+ };
75
+ export type IconType = keyof typeof ICON_LIBRARY;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ICON_CATEGORIES = exports.ICON_LIBRARY = void 0;
4
+ exports.ICON_LIBRARY = {
5
+ database: '🗄️',
6
+ server: '🖥️',
7
+ cloud: '☁️',
8
+ network: '🌐',
9
+ router: '📡',
10
+ security: '🔒',
11
+ warning: '⚠️',
12
+ error: '❌',
13
+ success: '✅',
14
+ info: 'ℹ️',
15
+ diamond: '💎',
16
+ gear: '⚙️',
17
+ tool: '🔧',
18
+ wrench: '🔨',
19
+ arrowUp: '⬆️',
20
+ arrowDown: '⬇️',
21
+ arrowLeft: '⬅️',
22
+ arrowRight: '➡️',
23
+ arrowUpRight: '↗️',
24
+ arrowDownRight: '↘️',
25
+ arrowDownLeft: '↙️',
26
+ arrowUpLeft: '↖️',
27
+ start: '🚀',
28
+ stop: '🛑',
29
+ pause: '⏸️',
30
+ play: '▶️',
31
+ process: '⚡',
32
+ email: '📧',
33
+ phone: '📞',
34
+ message: '💬',
35
+ notification: '🔔',
36
+ document: '📄',
37
+ folder: '📁',
38
+ file: '📋',
39
+ pdf: '📕',
40
+ image: '🖼️',
41
+ user: '👤',
42
+ users: '👥',
43
+ team: '👪',
44
+ admin: '👨‍💼',
45
+ add: '➕',
46
+ remove: '➖',
47
+ edit: '✏️',
48
+ search: '🔍',
49
+ filter: '🔽',
50
+ sort: '📊',
51
+ online: '🟢',
52
+ offline: '🔴',
53
+ pending: '🟡',
54
+ unknown: '⚪',
55
+ circle: '⭕',
56
+ square: '⬜',
57
+ triangle: '🔺',
58
+ star: '⭐',
59
+ heart: '❤️',
60
+ settings: '⚙️',
61
+ power: '🔌',
62
+ battery: '🔋',
63
+ wifi: '📶',
64
+ bluetooth: '📲',
65
+ };
66
+ exports.ICON_CATEGORIES = {
67
+ technical: ['database', 'server', 'cloud', 'network', 'router', 'security'],
68
+ status: ['warning', 'error', 'success', 'info', 'online', 'offline', 'pending', 'unknown'],
69
+ arrows: [
70
+ 'arrowUp',
71
+ 'arrowDown',
72
+ 'arrowLeft',
73
+ 'arrowRight',
74
+ 'arrowUpRight',
75
+ 'arrowDownRight',
76
+ 'arrowDownLeft',
77
+ 'arrowUpLeft',
78
+ ],
79
+ process: ['start', 'stop', 'pause', 'play', 'process', 'gear', 'tool', 'wrench'],
80
+ communication: ['email', 'phone', 'message', 'notification'],
81
+ files: ['document', 'folder', 'file', 'pdf', 'image'],
82
+ users: ['user', 'users', 'team', 'admin'],
83
+ actions: ['add', 'remove', 'edit', 'search', 'filter', 'sort'],
84
+ shapes: ['circle', 'square', 'triangle', 'star', 'heart', 'diamond'],
85
+ system: ['settings', 'power', 'battery', 'wifi', 'bluetooth'],
86
+ };
@@ -10,3 +10,7 @@ export * from './array.utils';
10
10
  export * from './abyss.utils';
11
11
  export * from './color.utils';
12
12
  export * from './board.utils';
13
+ export * from './file.utils';
14
+ export * from './compression.utils';
15
+ export * from './shape.utils';
16
+ export * from './icons.utils';
@@ -26,3 +26,7 @@ __exportStar(require("./array.utils"), exports);
26
26
  __exportStar(require("./abyss.utils"), exports);
27
27
  __exportStar(require("./color.utils"), exports);
28
28
  __exportStar(require("./board.utils"), exports);
29
+ __exportStar(require("./file.utils"), exports);
30
+ __exportStar(require("./compression.utils"), exports);
31
+ __exportStar(require("./shape.utils"), exports);
32
+ __exportStar(require("./icons.utils"), exports);
@@ -0,0 +1,22 @@
1
+ import { Id, PortId, Point, DrawSize, DrawStyle, DrawShapeToJsonResult } from '../types/draw.type';
2
+ export type Endpoint = {
3
+ style: DrawArrowEndpointStyle;
4
+ } & ({
5
+ kind: 'free';
6
+ x: number;
7
+ y: number;
8
+ } | {
9
+ kind: 'port';
10
+ shapeId: Id;
11
+ portId: PortId;
12
+ });
13
+ export type DrawArrowEndpointStyle = 'arrow' | 'circle' | 'square' | 'diamond' | 'none';
14
+ export declare const rectangleToSvg: (position: Point, size: DrawSize, style: DrawStyle) => string;
15
+ export declare const diamondToSvg: (position: Point, size: DrawSize, style: DrawStyle) => string;
16
+ export declare const ellipseToSvg: (position: Point, size: DrawSize, style: DrawStyle) => string;
17
+ export declare const textToSvg: (position: Point, style: DrawStyle, text: string) => string;
18
+ export declare const iconToSvg: (position: Point, size: DrawSize, style: DrawStyle, iconSymbol: string) => string;
19
+ export declare const imageToSvg: (position: Point, size: DrawSize, style: DrawStyle, src: string) => string;
20
+ export declare const commentToSvg: (position: Point, size: DrawSize, style: DrawStyle, id: string) => string;
21
+ export declare const arrowToSvg: (style: DrawStyle, startEndpoint: Endpoint, endEndpoint: Endpoint, fromPos: Point, toPos: Point) => string;
22
+ export declare const sceneToSVG: (shapes: DrawShapeToJsonResult[], width: number, height: number) => string;
@@ -0,0 +1,181 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sceneToSVG = exports.arrowToSvg = exports.commentToSvg = exports.imageToSvg = exports.iconToSvg = exports.textToSvg = exports.ellipseToSvg = exports.diamondToSvg = exports.rectangleToSvg = void 0;
4
+ const __1 = require("..");
5
+ const draw_type_1 = require("../types/draw.type");
6
+ const rectangleToSvg = (position, size, style) => {
7
+ const x = position.x - size.width / 2;
8
+ const y = position.y - size.height / 2;
9
+ const width = size.width;
10
+ const height = size.height;
11
+ const fillColor = style.fillColor === 'none' ? 'none' : style.fillColor;
12
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
13
+ const centerX = position.x;
14
+ const centerY = position.y;
15
+ return `<rect x="${x}" y="${y}" width="${width}" height="${height}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" opacity="${style.opacity}" rx="${style.cornerRadius}" ry="${style.cornerRadius}" stroke-dasharray="${style.lineDash || 'none'}" transform="rotate(${style.rotation} ${centerX} ${centerY})" />`;
16
+ };
17
+ exports.rectangleToSvg = rectangleToSvg;
18
+ const diamondToSvg = (position, size, style) => {
19
+ const cx = position.x;
20
+ const cy = position.y;
21
+ const halfWidth = size.width / 2;
22
+ const halfHeight = size.height / 2;
23
+ const fillColor = style.fillColor === 'none' ? 'none' : style.fillColor;
24
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
25
+ const points = [
26
+ `${cx},${cy - halfHeight}`,
27
+ `${cx + halfWidth},${cy}`,
28
+ `${cx},${cy + halfHeight}`,
29
+ `${cx - halfWidth},${cy}`,
30
+ ].join(' ');
31
+ return `<polygon points="${points}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" stroke-dasharray="${style.lineDash || 'none'}" opacity="${style.opacity}" transform="rotate(${style.rotation} ${cx} ${cy})" />`;
32
+ };
33
+ exports.diamondToSvg = diamondToSvg;
34
+ const ellipseToSvg = (position, size, style) => {
35
+ const cx = position.x;
36
+ const cy = position.y;
37
+ const radiusX = size.width / 2;
38
+ const radiusY = size.height / 2;
39
+ const fillColor = style.fillColor === 'none' ? 'none' : style.fillColor;
40
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
41
+ return `<ellipse cx="${cx}" cy="${cy}" rx="${radiusX}" ry="${radiusY}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" opacity="${style.opacity}" stroke-dasharray="${style.lineDash || 'none'}" transform="rotate(${style.rotation} ${cx} ${cy})" />`;
42
+ };
43
+ exports.ellipseToSvg = ellipseToSvg;
44
+ const textToSvg = (position, style, text) => {
45
+ const x = position.x;
46
+ const y = position.y;
47
+ const fillColor = style.fillColor === 'none' ? 'none' : style.fillColor;
48
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
49
+ return `<text x="${x}" y="${y}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" opacity="${style.opacity}" font-size="${style.fontSize}" font-family="${style.fontFamily}"
50
+ stroke-dasharray="${style.lineDash || 'none'}" text-anchor="middle" dominant-baseline="middle" transform="rotate(${style.rotation} ${x} ${y})">${text}</text>`;
51
+ };
52
+ exports.textToSvg = textToSvg;
53
+ const iconToSvg = (position, size, style, iconSymbol) => {
54
+ const x = position.x;
55
+ const y = position.y;
56
+ const fillColor = style.fillColor === 'none' ? 'none' : style.fillColor;
57
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
58
+ const fontSize = Math.min(size.width, size.height) * 0.8;
59
+ return `<text x="${x}" y="${y}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" opacity="${style.opacity}" font-size="${fontSize}" font-family="Arial" text-anchor="middle" dominant-baseline="middle" transform="rotate(${style.rotation} ${x} ${y})">${iconSymbol}</text>`;
60
+ };
61
+ exports.iconToSvg = iconToSvg;
62
+ const imageToSvg = (position, size, style, src) => {
63
+ const x = position.x - size.width / 2;
64
+ const y = position.y - size.height / 2;
65
+ const width = size.width;
66
+ const height = size.height;
67
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
68
+ const centerX = position.x;
69
+ const centerY = position.y;
70
+ return `<image x="${x}" y="${y}" width="${width}" height="${height}" href="${src}" opacity="${style.opacity}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" rx="${style.cornerRadius}" ry="${style.cornerRadius}" transform="rotate(${style.rotation} ${centerX} ${centerY})" />`;
71
+ };
72
+ exports.imageToSvg = imageToSvg;
73
+ const commentToSvg = (position, size, style, id) => {
74
+ const cx = position.x;
75
+ const cy = position.y;
76
+ const radius = size.width / 2;
77
+ const fillColor = style.fillColor === 'none' ? 'transparent' : style.fillColor;
78
+ const strokeColor = style.strokeColor === 'none' ? 'none' : style.strokeColor;
79
+ const fontSize = size.width * 0.6;
80
+ const textX = cx;
81
+ const textY = cy + fontSize * 0.35;
82
+ return `
83
+ <g opacity="${style.opacity}" transform="rotate(${style.rotation} ${cx} ${cy})">
84
+ <defs>
85
+ <filter id="comment-shadow-${id}" x="-50%" y="-50%" width="200%" height="200%">
86
+ <feDropShadow dx="2" dy="2" stdDeviation="5" flood-color="black" flood-opacity="0.3"/>
87
+ </filter>
88
+ </defs>
89
+ <circle cx="${cx}" cy="${cy}" r="${radius}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${style.strokeWidth}" filter="url(#comment-shadow-${id})" />
90
+ <text x="${textX}" y="${textY}" fill="white" font-size="${fontSize}" font-family="Arial" text-anchor="middle" dominant-baseline="middle" font-weight="bold">!</text>
91
+ </g>`;
92
+ };
93
+ exports.commentToSvg = commentToSvg;
94
+ const renderEndpointStyleSvg = (x, y, style, angle, strokeColor, fillColor, strokeWidth) => {
95
+ switch (style) {
96
+ case 'circle':
97
+ return `<circle cx="${x}" cy="${y}" r="6" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${strokeWidth}" />`;
98
+ case 'square':
99
+ const squareX = x - 6;
100
+ const squareY = y - 6;
101
+ return `<rect x="${squareX}" y="${squareY}" width="12" height="12" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${strokeWidth}" transform="rotate(${angle * (180 / Math.PI)} ${x} ${y})" />`;
102
+ case 'diamond':
103
+ return `<polygon points="${x},${y - 6} ${x + 6},${y} ${x},${y + 6} ${x - 6},${y}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${strokeWidth}" transform="rotate(${angle * (180 / Math.PI)} ${x} ${y})" />`;
104
+ case 'arrow':
105
+ const arrowSize = 8;
106
+ const x1 = x - arrowSize * Math.cos(angle - Math.PI / 6);
107
+ const y1 = y - arrowSize * Math.sin(angle - Math.PI / 6);
108
+ const x2 = x - arrowSize * Math.cos(angle + Math.PI / 6);
109
+ const y2 = y - arrowSize * Math.sin(angle + Math.PI / 6);
110
+ return `<polygon points="${x},${y} ${x1},${y1} ${x2},${y2}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${strokeWidth}" />`;
111
+ case 'none':
112
+ default:
113
+ return '';
114
+ }
115
+ };
116
+ const arrowToSvg = (style, startEndpoint, endEndpoint, fromPos, toPos) => {
117
+ const angle = Math.atan2(toPos.y - fromPos.y, toPos.x - fromPos.x);
118
+ let svg = `<g opacity="${style.opacity}">`;
119
+ svg += `<line x1="${fromPos.x}" y1="${fromPos.y}" x2="${toPos.x}" y2="${toPos.y}" stroke="${style.strokeColor}" stroke-width="${style.strokeWidth}" />`;
120
+ svg += renderEndpointStyleSvg(fromPos.x, fromPos.y, startEndpoint.style, angle + Math.PI, style.strokeColor, style.fillColor, style.strokeWidth);
121
+ svg += renderEndpointStyleSvg(toPos.x, toPos.y, endEndpoint.style, angle, style.strokeColor, style.fillColor, style.strokeWidth);
122
+ svg += '</g>';
123
+ return svg;
124
+ };
125
+ exports.arrowToSvg = arrowToSvg;
126
+ const sceneToSVG = (shapes, width, height) => {
127
+ const shapeEls = shapes
128
+ .sort((a, b) => (a.zIndex || 0) - (b.zIndex || 0))
129
+ .map((s) => {
130
+ var _a, _b;
131
+ switch (s.type) {
132
+ case draw_type_1.DrawShapeType.RECTANGLE:
133
+ return (0, exports.rectangleToSvg)(s.position, s.size, s.style);
134
+ case draw_type_1.DrawShapeType.DIAMOND:
135
+ return (0, exports.diamondToSvg)(s.position, s.size, s.style);
136
+ case draw_type_1.DrawShapeType.ELLIPSE:
137
+ return (0, exports.ellipseToSvg)(s.position, s.size, s.style);
138
+ case draw_type_1.DrawShapeType.TEXT:
139
+ return (0, exports.textToSvg)(s.position, s.style, s.text || '');
140
+ case draw_type_1.DrawShapeType.ICON:
141
+ const iconSymbol = __1.ICON_LIBRARY[s.iconType] || '';
142
+ return (0, exports.iconToSvg)(s.position, s.size, s.style, iconSymbol);
143
+ case draw_type_1.DrawShapeType.IMAGE:
144
+ return (0, exports.imageToSvg)(s.position, s.size, s.style, s.src);
145
+ case draw_type_1.DrawShapeType.COMMENT:
146
+ return (0, exports.commentToSvg)(s.position, s.size, s.style, s.id);
147
+ case draw_type_1.DrawShapeType.ARROW:
148
+ if (s.startEndpoint && s.endEndpoint) {
149
+ const fromPos = s.startEndpoint.kind === 'port'
150
+ ? (_a = shapes.find((shape) => { var _a; return shape.id === ((_a = s.startEndpoint) === null || _a === void 0 ? void 0 : _a.shapeId); })) === null || _a === void 0 ? void 0 : _a.position
151
+ : {
152
+ x: s.startEndpoint.x,
153
+ y: s.startEndpoint.y,
154
+ };
155
+ const toPos = s.endEndpoint.kind === 'port'
156
+ ? (_b = shapes.find((shape) => { var _a; return shape.id === ((_a = s.endEndpoint) === null || _a === void 0 ? void 0 : _a.shapeId); })) === null || _b === void 0 ? void 0 : _b.position
157
+ : {
158
+ x: s.endEndpoint.x,
159
+ y: s.endEndpoint.y,
160
+ };
161
+ if (!fromPos || !toPos)
162
+ return '';
163
+ return (0, exports.arrowToSvg)(s.style, s.startEndpoint, s.endEndpoint, fromPos, toPos);
164
+ }
165
+ return '';
166
+ default:
167
+ return '';
168
+ }
169
+ });
170
+ const defs = `
171
+ <defs>
172
+ <marker id="arrow" markerWidth="10" markerHeight="10" refX="10" refY="5" orient="auto-start-reverse">
173
+ <path d="M0,0 L10,5 L0,10 z" fill="currentColor"/>
174
+ </marker>
175
+ </defs>`;
176
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">
177
+ ${defs}
178
+ ${shapeEls.join('\n')}
179
+ </svg>`;
180
+ };
181
+ exports.sceneToSVG = sceneToSVG;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",