@abyss-project/main 1.0.68 → 1.0.71

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/atlas-document.api.d.ts +6 -0
  2. package/dist/api/atlas-document.api.js +26 -0
  3. package/dist/api/index.d.ts +3 -0
  4. package/dist/api/index.js +3 -0
  5. package/dist/api/short-link.admin.api.d.ts +7 -0
  6. package/dist/api/short-link.admin.api.js +22 -0
  7. package/dist/api/short-link.api.d.ts +4 -7
  8. package/dist/api/short-link.api.js +8 -18
  9. package/dist/api/short-link.public.api.d.ts +8 -0
  10. package/dist/api/short-link.public.api.js +32 -0
  11. package/dist/constants/atlas.constants.d.ts +2 -0
  12. package/dist/constants/atlas.constants.js +5 -0
  13. package/dist/constants/index.d.ts +2 -0
  14. package/dist/constants/index.js +2 -0
  15. package/dist/constants/short-link.constants.d.ts +8 -0
  16. package/dist/constants/short-link.constants.js +11 -0
  17. package/dist/server-sent-events/protocols/atlas/atlas.sse-protocol.d.ts +14 -2
  18. package/dist/server-sent-events/protocols/atlas/atlas.sse-protocol.js +3 -1
  19. package/dist/types/enum/abyss-application-event.enum.d.ts +2 -0
  20. package/dist/types/enum/abyss-application-event.enum.js +2 -0
  21. package/dist/types/enum/api-error.enum.d.ts +1 -0
  22. package/dist/types/enum/api-error.enum.js +1 -0
  23. package/dist/types/enum/index.d.ts +1 -0
  24. package/dist/types/enum/index.js +1 -0
  25. package/dist/types/enum/user-agent.enum.d.ts +22 -0
  26. package/dist/types/enum/user-agent.enum.js +28 -0
  27. package/dist/types/interface/api/index.d.ts +4 -0
  28. package/dist/types/interface/api/index.js +4 -0
  29. package/dist/types/interface/api/requests/atlas-document.request.d.ts +26 -0
  30. package/dist/types/interface/api/requests/atlas-document.request.js +2 -0
  31. package/dist/types/interface/api/requests/short-link.admin.request.d.ts +4 -1
  32. package/dist/types/interface/api/requests/short-link.public.request.d.ts +33 -0
  33. package/dist/types/interface/api/requests/short-link.public.request.js +2 -0
  34. package/dist/types/interface/api/requests/short-link.request.d.ts +7 -26
  35. package/dist/types/interface/api/responses/atlas-document.response.d.ts +18 -0
  36. package/dist/types/interface/api/responses/atlas-document.response.js +2 -0
  37. package/dist/types/interface/api/responses/short-link.admin.response.d.ts +2 -0
  38. package/dist/types/interface/api/responses/short-link.public.response.d.ts +20 -0
  39. package/dist/types/interface/api/responses/short-link.public.response.js +2 -0
  40. package/dist/types/interface/api/responses/short-link.response.d.ts +4 -15
  41. package/dist/types/interface/index.d.ts +1 -0
  42. package/dist/types/interface/index.js +1 -0
  43. package/dist/types/interface/models/atlas-document.model.d.ts +19 -0
  44. package/dist/types/interface/models/atlas-document.model.js +2 -0
  45. package/dist/types/interface/models/atlas-page.model.d.ts +2 -0
  46. package/dist/types/interface/models/atlas.model.d.ts +2 -0
  47. package/dist/types/interface/models/short-link-click.model.d.ts +13 -1
  48. package/dist/types/interface/models/short-link.model.d.ts +16 -0
  49. package/dist/utils/index.d.ts +3 -0
  50. package/dist/utils/index.js +3 -0
  51. package/dist/utils/string.utils.d.ts +6 -0
  52. package/dist/utils/string.utils.js +45 -0
  53. package/dist/utils/tracking.utils.d.ts +11 -0
  54. package/dist/utils/tracking.utils.js +60 -0
  55. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import { IDeleteAtlasDocumentParams, IDeleteAtlasDocumentResponse, IGetAtlasDocumentParams, IGetAtlasDocumentResponse, IGetUploadPreSignedUrlAtlasDocumentBody, IGetUploadPreSignedUrlAtlasDocumentParams, IGetUploadPreSignedUrlAtlasDocumentResponse, IPaginateAtlasDocumentParams, IPaginateAtlasDocumentQuery, IPaginateAtlasDocumentResponse, IListAtlasDocumentParams, IListAtlasDocumentResponse } from '../types';
2
+ export declare const getAtlasDocument: (params: IGetAtlasDocumentParams) => Promise<IGetAtlasDocumentResponse>;
3
+ export declare const deleteAtlasDocument: (params: IDeleteAtlasDocumentParams) => Promise<IDeleteAtlasDocumentResponse>;
4
+ export declare const getUploadPreSignedUrlAtlasDocument: (params: IGetUploadPreSignedUrlAtlasDocumentParams, body: IGetUploadPreSignedUrlAtlasDocumentBody) => Promise<IGetUploadPreSignedUrlAtlasDocumentResponse>;
5
+ export declare const paginateAtlasDocument: (params: IPaginateAtlasDocumentParams, query?: IPaginateAtlasDocumentQuery) => Promise<IPaginateAtlasDocumentResponse>;
6
+ export declare const listAtlasDocument: (params: IListAtlasDocumentParams) => Promise<IListAtlasDocumentResponse>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listAtlasDocument = exports.paginateAtlasDocument = exports.getUploadPreSignedUrlAtlasDocument = exports.deleteAtlasDocument = exports.getAtlasDocument = void 0;
4
+ const __1 = require("..");
5
+ const getAtlasDocument = async (params) => {
6
+ return (await __1.AbyssCore.axios.get(`atlas/${params.atlasId}/document/${params.atlasDocumentId}`)).data;
7
+ };
8
+ exports.getAtlasDocument = getAtlasDocument;
9
+ const deleteAtlasDocument = async (params) => {
10
+ return (await __1.AbyssCore.axios.delete(`atlas/${params.atlasId}/document/${params.atlasDocumentId}`)).data;
11
+ };
12
+ exports.deleteAtlasDocument = deleteAtlasDocument;
13
+ const getUploadPreSignedUrlAtlasDocument = async (params, body) => {
14
+ return (await __1.AbyssCore.axios.post(`atlas/${params.atlasId}/document/${params.atlasPageId}`, body)).data;
15
+ };
16
+ exports.getUploadPreSignedUrlAtlasDocument = getUploadPreSignedUrlAtlasDocument;
17
+ const paginateAtlasDocument = async (params, query) => {
18
+ return (await __1.AbyssCore.axios.get(`atlas/${params.atlasId}/document`, {
19
+ params: query,
20
+ })).data;
21
+ };
22
+ exports.paginateAtlasDocument = paginateAtlasDocument;
23
+ const listAtlasDocument = async (params) => {
24
+ return (await __1.AbyssCore.axios.get(`atlas/${params.atlasId}/document/page/${params.atlasPageId}`)).data;
25
+ };
26
+ exports.listAtlasDocument = listAtlasDocument;
@@ -39,6 +39,9 @@ export * from './retrospective.public.api';
39
39
  export * from './atlas.api';
40
40
  export * from './atlas-group.api';
41
41
  export * from './atlas-page.api';
42
+ export * from './atlas-document.api';
42
43
  export * from './atlas.public.api';
43
44
  export * from './memo.api';
44
45
  export * from './short-link.api';
46
+ export * from './short-link.admin.api';
47
+ export * from './short-link.public.api';
package/dist/api/index.js CHANGED
@@ -55,6 +55,9 @@ __exportStar(require("./retrospective.public.api"), exports);
55
55
  __exportStar(require("./atlas.api"), exports);
56
56
  __exportStar(require("./atlas-group.api"), exports);
57
57
  __exportStar(require("./atlas-page.api"), exports);
58
+ __exportStar(require("./atlas-document.api"), exports);
58
59
  __exportStar(require("./atlas.public.api"), exports);
59
60
  __exportStar(require("./memo.api"), exports);
60
61
  __exportStar(require("./short-link.api"), exports);
62
+ __exportStar(require("./short-link.admin.api"), exports);
63
+ __exportStar(require("./short-link.public.api"), exports);
@@ -0,0 +1,7 @@
1
+ import type { IPaginateShortLinkAdminQuery, IPaginateShortLinkAdminResponse, IGetShortLinkAdminParams, IGetShortLinkAdminResponse, IUpdateShortLinkAdminParams, IUpdateShortLinkAdminBody, IUpdateShortLinkAdminResponse, IDeleteShortLinkAdminParams, IDeleteShortLinkAdminResponse } from '../types';
2
+ export declare const shortLinkAdminApi: {
3
+ paginate: (query: IPaginateShortLinkAdminQuery) => Promise<IPaginateShortLinkAdminResponse>;
4
+ get: (params: IGetShortLinkAdminParams) => Promise<IGetShortLinkAdminResponse>;
5
+ update: (params: IUpdateShortLinkAdminParams, body: IUpdateShortLinkAdminBody) => Promise<IUpdateShortLinkAdminResponse>;
6
+ delete: (params: IDeleteShortLinkAdminParams) => Promise<IDeleteShortLinkAdminResponse>;
7
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shortLinkAdminApi = void 0;
4
+ const index_1 = require("../index");
5
+ exports.shortLinkAdminApi = {
6
+ paginate: async (query) => {
7
+ const response = await index_1.AbyssCore.axios.get('/admin/short-link/paginate', { params: query });
8
+ return response.data;
9
+ },
10
+ get: async (params) => {
11
+ const response = await index_1.AbyssCore.axios.get(`/admin/short-link/${params.shortLinkId}`);
12
+ return response.data;
13
+ },
14
+ update: async (params, body) => {
15
+ const response = await index_1.AbyssCore.axios.put(`/admin/short-link/${params.shortLinkId}`, body);
16
+ return response.data;
17
+ },
18
+ delete: async (params) => {
19
+ const response = await index_1.AbyssCore.axios.delete(`/admin/short-link/${params.shortLinkId}`);
20
+ return response.data;
21
+ },
22
+ };
@@ -1,15 +1,12 @@
1
- import type { IGetShortLinkParams, IGetShortLinkResponse, IGetShortLinkBySlugParams, IGetShortLinkBySlugResponse, IValidateShortLinkPasswordBody, IValidateShortLinkPasswordResponse, IPaginateShortLinkQuery, IPaginateShortLinkResponse, IPaginateUserShortLinkQuery, IPaginateProjectShortLinkParams, IPaginateProjectShortLinkQuery, ICreateShortLinkBody, ICreateShortLinkResponse, ICreateForProjectShortLinkParams, IUpdateShortLinkParams, IUpdateShortLinkBody, IUpdateShortLinkResponse, IDeleteShortLinkParams, IDeleteShortLinkResponse, IGetShortLinkStatsParams, IGetShortLinkStatsQuery, IGetShortLinkStatsResponse } from '../types';
1
+ import type { IGetShortLinkParams, IGetShortLinkResponse, IPaginateShortLinkQuery, IPaginateShortLinkResponse, IPaginateProjectShortLinkParams, ICreateShortLinkBody, ICreateShortLinkResponse, ICreateForProjectShortLinkParams, IUpdateShortLinkParams, IUpdateShortLinkBody, IUpdateShortLinkResponse, IDeleteShortLinkParams, IDeleteShortLinkResponse, IGetStatsShortLinkParams, IGetStatsShortLinkQuery, IGetStatsShortLinkResponse, IGetClicksShortLinkParams, IGetClicksShortLinkQuery, IGetClicksShortLinkResponse } from '../types';
2
2
  export declare const shortLinkApi: {
3
3
  get: (params: IGetShortLinkParams) => Promise<IGetShortLinkResponse>;
4
- getBySlug: (params: IGetShortLinkBySlugParams) => Promise<IGetShortLinkBySlugResponse>;
5
- validatePassword: (params: IGetShortLinkBySlugParams, body: IValidateShortLinkPasswordBody) => Promise<IValidateShortLinkPasswordResponse>;
6
4
  paginate: (query: IPaginateShortLinkQuery) => Promise<IPaginateShortLinkResponse>;
7
- paginateUser: (query: IPaginateUserShortLinkQuery) => Promise<IPaginateShortLinkResponse>;
8
- paginateProject: (params: IPaginateProjectShortLinkParams, query: IPaginateProjectShortLinkQuery) => Promise<IPaginateShortLinkResponse>;
5
+ paginateProject: (params: IPaginateProjectShortLinkParams, query: IPaginateShortLinkQuery) => Promise<IPaginateShortLinkResponse>;
9
6
  create: (body: ICreateShortLinkBody) => Promise<ICreateShortLinkResponse>;
10
- createAnonymous: (body: ICreateShortLinkBody) => Promise<ICreateShortLinkResponse>;
11
7
  createForProject: (params: ICreateForProjectShortLinkParams, body: ICreateShortLinkBody) => Promise<ICreateShortLinkResponse>;
12
8
  update: (params: IUpdateShortLinkParams, body: IUpdateShortLinkBody) => Promise<IUpdateShortLinkResponse>;
13
9
  delete: (params: IDeleteShortLinkParams) => Promise<IDeleteShortLinkResponse>;
14
- getStats: (params: IGetShortLinkStatsParams, query?: IGetShortLinkStatsQuery) => Promise<IGetShortLinkStatsResponse>;
10
+ getStats: (params: IGetStatsShortLinkParams, query?: IGetStatsShortLinkQuery) => Promise<IGetStatsShortLinkResponse>;
11
+ getClicks: (params: IGetClicksShortLinkParams, query?: IGetClicksShortLinkQuery) => Promise<IGetClicksShortLinkResponse>;
15
12
  };
@@ -7,22 +7,10 @@ exports.shortLinkApi = {
7
7
  const response = await index_1.AbyssCore.axios.get(`/short-link/${params.shortLinkId}`);
8
8
  return response.data;
9
9
  },
10
- getBySlug: async (params) => {
11
- const response = await index_1.AbyssCore.axios.get(`/short-link/slug/${params.slug}`);
12
- return response.data;
13
- },
14
- validatePassword: async (params, body) => {
15
- const response = await index_1.AbyssCore.axios.post(`/short-link/slug/${params.slug}/validate-password`, body);
16
- return response.data;
17
- },
18
10
  paginate: async (query) => {
19
11
  const response = await index_1.AbyssCore.axios.get('/short-link/paginate', { params: query });
20
12
  return response.data;
21
13
  },
22
- paginateUser: async (query) => {
23
- const response = await index_1.AbyssCore.axios.get('/short-link/user/paginate', { params: query });
24
- return response.data;
25
- },
26
14
  paginateProject: async (params, query) => {
27
15
  const response = await index_1.AbyssCore.axios.get(`/short-link/project/${params.projectId}/paginate`, {
28
16
  params: query,
@@ -30,15 +18,11 @@ exports.shortLinkApi = {
30
18
  return response.data;
31
19
  },
32
20
  create: async (body) => {
33
- const response = await index_1.AbyssCore.axios.post('/short-link/create', body);
34
- return response.data;
35
- },
36
- createAnonymous: async (body) => {
37
- const response = await index_1.AbyssCore.axios.post('/short-link/create-anonymous', body);
21
+ const response = await index_1.AbyssCore.axios.post('/short-link', body);
38
22
  return response.data;
39
23
  },
40
24
  createForProject: async (params, body) => {
41
- const response = await index_1.AbyssCore.axios.post(`/short-link/project/${params.projectId}/create`, body);
25
+ const response = await index_1.AbyssCore.axios.post(`/short-link/project/${params.projectId}`, body);
42
26
  return response.data;
43
27
  },
44
28
  update: async (params, body) => {
@@ -55,4 +39,10 @@ exports.shortLinkApi = {
55
39
  });
56
40
  return response.data;
57
41
  },
42
+ getClicks: async (params, query) => {
43
+ const response = await index_1.AbyssCore.axios.get(`/short-link/${params.shortLinkId}/clicks`, {
44
+ params: query,
45
+ });
46
+ return response.data;
47
+ },
58
48
  };
@@ -0,0 +1,8 @@
1
+ import type { ICreateAnonymousShortLinkPublicBody, ICreateShortLinkPublicResponse, IGetStatsShortLinkPublicParams, IGetStatsShortLinkPublicQuery, IGetStatsShortLinkPublicResponse, IGetClicksShortLinkPublicParams, IGetClicksShortLinkPublicQuery, IGetClicksShortLinkPublicResponse, IRenewShortLinkPublicParams, IRenewShortLinkPublicResponse, IRedirectShortLinkPublicParams, IRedirectShortLinkPublicQuery, IRedirectShortLinkPublicResponse } from '../types';
2
+ export declare const shortLinkPublicApi: {
3
+ createAnonymous: (body: ICreateAnonymousShortLinkPublicBody) => Promise<ICreateShortLinkPublicResponse>;
4
+ redirect: (params: IRedirectShortLinkPublicParams, query?: IRedirectShortLinkPublicQuery) => Promise<IRedirectShortLinkPublicResponse>;
5
+ getStats: (params: IGetStatsShortLinkPublicParams, query?: IGetStatsShortLinkPublicQuery) => Promise<IGetStatsShortLinkPublicResponse>;
6
+ getClicks: (params: IGetClicksShortLinkPublicParams, query?: IGetClicksShortLinkPublicQuery) => Promise<IGetClicksShortLinkPublicResponse>;
7
+ renew: (params: IRenewShortLinkPublicParams) => Promise<IRenewShortLinkPublicResponse>;
8
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shortLinkPublicApi = void 0;
4
+ const index_1 = require("../index");
5
+ exports.shortLinkPublicApi = {
6
+ createAnonymous: async (body) => {
7
+ const response = await index_1.AbyssCore.axios.post('/short-link/public', body);
8
+ return response.data;
9
+ },
10
+ redirect: async (params, query) => {
11
+ const response = await index_1.AbyssCore.axios.get(`/short-link/public/redirect/${params.slug}`, {
12
+ params: query,
13
+ });
14
+ return response.data;
15
+ },
16
+ getStats: async (params, query) => {
17
+ const response = await index_1.AbyssCore.axios.get(`/short-link/public/${params.shortLinkId}/stats`, {
18
+ params: query,
19
+ });
20
+ return response.data;
21
+ },
22
+ getClicks: async (params, query) => {
23
+ const response = await index_1.AbyssCore.axios.get(`/short-link/public/${params.shortLinkId}/clicks`, {
24
+ params: query,
25
+ });
26
+ return response.data;
27
+ },
28
+ renew: async (params) => {
29
+ const response = await index_1.AbyssCore.axios.post(`/short-link/public/${params.shortLinkId}/renew`);
30
+ return response.data;
31
+ },
32
+ };
@@ -0,0 +1,2 @@
1
+ export declare const MAX_DOCUMENTS_PER_ATLAS_PAGE = 20;
2
+ export declare const MAX_ATLAS_DOCUMENT_SIZE_OCTET: number;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_ATLAS_DOCUMENT_SIZE_OCTET = exports.MAX_DOCUMENTS_PER_ATLAS_PAGE = void 0;
4
+ exports.MAX_DOCUMENTS_PER_ATLAS_PAGE = 20;
5
+ exports.MAX_ATLAS_DOCUMENT_SIZE_OCTET = 20 * 1024 * 1024;
@@ -1,2 +1,4 @@
1
1
  export * from './board.constants';
2
2
  export * from './memo.constants';
3
+ export * from './short-link.constants';
4
+ export * from './atlas.constants';
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./board.constants"), exports);
18
18
  __exportStar(require("./memo.constants"), exports);
19
+ __exportStar(require("./short-link.constants"), exports);
20
+ __exportStar(require("./atlas.constants"), exports);
@@ -0,0 +1,8 @@
1
+ export declare const MIN_SHORT_LINK_PAGE = 1;
2
+ export declare const MIN_SHORT_LINK_LIMIT = 1;
3
+ export declare const MAX_SHORT_LINK_LIMIT = 500;
4
+ export declare const MAX_SHORT_LINK_TITLE_LENGTH = 255;
5
+ export declare const MAX_SHORT_LINK_DESCRIPTION_LENGTH = 1000;
6
+ export declare const MIN_SHORT_LINK_MAX_CLICKS = 1;
7
+ export declare const MIN_SHORT_LINK_SLUG_LENGTH = 3;
8
+ export declare const MAX_SHORT_LINK_SLUG_LENGTH = 50;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_SHORT_LINK_SLUG_LENGTH = exports.MIN_SHORT_LINK_SLUG_LENGTH = exports.MIN_SHORT_LINK_MAX_CLICKS = exports.MAX_SHORT_LINK_DESCRIPTION_LENGTH = exports.MAX_SHORT_LINK_TITLE_LENGTH = exports.MAX_SHORT_LINK_LIMIT = exports.MIN_SHORT_LINK_LIMIT = exports.MIN_SHORT_LINK_PAGE = void 0;
4
+ exports.MIN_SHORT_LINK_PAGE = 1;
5
+ exports.MIN_SHORT_LINK_LIMIT = 1;
6
+ exports.MAX_SHORT_LINK_LIMIT = 500;
7
+ exports.MAX_SHORT_LINK_TITLE_LENGTH = 255;
8
+ exports.MAX_SHORT_LINK_DESCRIPTION_LENGTH = 1000;
9
+ exports.MIN_SHORT_LINK_MAX_CLICKS = 1;
10
+ exports.MIN_SHORT_LINK_SLUG_LENGTH = 3;
11
+ exports.MAX_SHORT_LINK_SLUG_LENGTH = 50;
@@ -1,6 +1,6 @@
1
1
  import { SystemSSEMessageContent } from '..';
2
2
  import { ValueOf } from '../../../types';
3
- import { IAtlas, IAtlasGroup, IAtlasPage } from '../../../types/interface';
3
+ import { IAtlas, IAtlasGroup, IAtlasPage, IAtlasDocument } from '../../../types/interface';
4
4
  export declare enum AtlasSSEEvent {
5
5
  ATLAS_UPDATED = "ATLAS_UPDATED",
6
6
  ATLAS_DELETED = "ATLAS_DELETED",
@@ -10,7 +10,9 @@ export declare enum AtlasSSEEvent {
10
10
  PAGE_CREATED = "PAGE_CREATED",
11
11
  PAGE_UPDATED = "PAGE_UPDATED",
12
12
  PAGE_DELETED = "PAGE_DELETED",
13
- PAGE_CONTENT_DIFF_UPDATED = "PAGE_CONTENT_DIFF_UPDATED"
13
+ PAGE_CONTENT_DIFF_UPDATED = "PAGE_CONTENT_DIFF_UPDATED",
14
+ ATLAS_DOCUMENT_CREATE = "ATLAS_DOCUMENT_CREATE",
15
+ ATLAS_DOCUMENT_DELETE = "ATLAS_DOCUMENT_DELETE"
14
16
  }
15
17
  export type AtlasSSEMessageContent = ValueOf<{
16
18
  [K in AtlasSSEEvent]: {
@@ -58,5 +60,15 @@ export declare class SourceAtlasSSEEventPayload implements Record<AtlasSSEEvent,
58
60
  version: number;
59
61
  lastModifiedByUserId?: string;
60
62
  };
63
+ [AtlasSSEEvent.ATLAS_DOCUMENT_CREATE]: {
64
+ atlasId: string;
65
+ atlasPageId: string;
66
+ atlasDocument: IAtlasDocument;
67
+ };
68
+ [AtlasSSEEvent.ATLAS_DOCUMENT_DELETE]: {
69
+ atlasId: string;
70
+ atlasPageId: string;
71
+ atlasDocumentId: string;
72
+ };
61
73
  }
62
74
  export type AtlasSSEEventContent = AtlasSSEMessageContent | SystemSSEMessageContent;
@@ -12,8 +12,10 @@ var AtlasSSEEvent;
12
12
  AtlasSSEEvent["PAGE_UPDATED"] = "PAGE_UPDATED";
13
13
  AtlasSSEEvent["PAGE_DELETED"] = "PAGE_DELETED";
14
14
  AtlasSSEEvent["PAGE_CONTENT_DIFF_UPDATED"] = "PAGE_CONTENT_DIFF_UPDATED";
15
+ AtlasSSEEvent["ATLAS_DOCUMENT_CREATE"] = "ATLAS_DOCUMENT_CREATE";
16
+ AtlasSSEEvent["ATLAS_DOCUMENT_DELETE"] = "ATLAS_DOCUMENT_DELETE";
15
17
  })(AtlasSSEEvent || (exports.AtlasSSEEvent = AtlasSSEEvent = {}));
16
18
  class SourceAtlasSSEEventPayload {
17
19
  }
18
20
  exports.SourceAtlasSSEEventPayload = SourceAtlasSSEEventPayload;
19
- AtlasSSEEvent.ATLAS_UPDATED, AtlasSSEEvent.ATLAS_DELETED, AtlasSSEEvent.GROUP_CREATED, AtlasSSEEvent.GROUP_UPDATED, AtlasSSEEvent.GROUP_DELETED, AtlasSSEEvent.PAGE_CREATED, AtlasSSEEvent.PAGE_UPDATED, AtlasSSEEvent.PAGE_DELETED, AtlasSSEEvent.PAGE_CONTENT_DIFF_UPDATED;
21
+ AtlasSSEEvent.ATLAS_UPDATED, AtlasSSEEvent.ATLAS_DELETED, AtlasSSEEvent.GROUP_CREATED, AtlasSSEEvent.GROUP_UPDATED, AtlasSSEEvent.GROUP_DELETED, AtlasSSEEvent.PAGE_CREATED, AtlasSSEEvent.PAGE_UPDATED, AtlasSSEEvent.PAGE_DELETED, AtlasSSEEvent.PAGE_CONTENT_DIFF_UPDATED, AtlasSSEEvent.ATLAS_DOCUMENT_CREATE, AtlasSSEEvent.ATLAS_DOCUMENT_DELETE;
@@ -81,6 +81,8 @@ export declare enum AbyssApplicationEvent {
81
81
  ATLAS_PAGE_CONTENT_CREATE = "atlas-page-content.create",
82
82
  ATLAS_PAGE_CONTENT_UPDATE = "atlas-page-content.update",
83
83
  ATLAS_PAGE_CONTENT_DELETE = "atlas-page-content.delete",
84
+ ATLAS_DOCUMENT_CREATE = "atlas-document.create",
85
+ ATLAS_DOCUMENT_DELETE = "atlas-document.delete",
84
86
  MEMO_CREATE = "memo.create",
85
87
  MEMO_UPDATE = "memo.update",
86
88
  MEMO_DELETE = "memo.delete",
@@ -85,6 +85,8 @@ var AbyssApplicationEvent;
85
85
  AbyssApplicationEvent["ATLAS_PAGE_CONTENT_CREATE"] = "atlas-page-content.create";
86
86
  AbyssApplicationEvent["ATLAS_PAGE_CONTENT_UPDATE"] = "atlas-page-content.update";
87
87
  AbyssApplicationEvent["ATLAS_PAGE_CONTENT_DELETE"] = "atlas-page-content.delete";
88
+ AbyssApplicationEvent["ATLAS_DOCUMENT_CREATE"] = "atlas-document.create";
89
+ AbyssApplicationEvent["ATLAS_DOCUMENT_DELETE"] = "atlas-document.delete";
88
90
  AbyssApplicationEvent["MEMO_CREATE"] = "memo.create";
89
91
  AbyssApplicationEvent["MEMO_UPDATE"] = "memo.update";
90
92
  AbyssApplicationEvent["MEMO_DELETE"] = "memo.delete";
@@ -39,5 +39,6 @@ export declare enum Code {
39
39
  unableToDeleteFormExist = "unable_to_delete_form_exist",
40
40
  boardCardDocumentLimitReached = "board_card_document_limit_reached",
41
41
  boardCardMoveInvalidDestination = "board_card_move_invalid_destination",
42
+ atlasDocumentLimitReached = "atlas_document_limit_reached",
42
43
  retrospectiveCannotBeModifiedWhenCompleted = "retrospective_cannot_be_modified_when_completed"
43
44
  }
@@ -44,5 +44,6 @@ var Code;
44
44
  Code["unableToDeleteFormExist"] = "unable_to_delete_form_exist";
45
45
  Code["boardCardDocumentLimitReached"] = "board_card_document_limit_reached";
46
46
  Code["boardCardMoveInvalidDestination"] = "board_card_move_invalid_destination";
47
+ Code["atlasDocumentLimitReached"] = "atlas_document_limit_reached";
47
48
  Code["retrospectiveCannotBeModifiedWhenCompleted"] = "retrospective_cannot_be_modified_when_completed";
48
49
  })(Code || (exports.Code = Code = {}));
@@ -22,3 +22,4 @@ export * from './user-type.enum';
22
22
  export * from './onboarding-steps.enum';
23
23
  export * from './board-column-type.enum';
24
24
  export * from './board-activity.enum';
25
+ export * from './user-agent.enum';
@@ -38,3 +38,4 @@ __exportStar(require("./user-type.enum"), exports);
38
38
  __exportStar(require("./onboarding-steps.enum"), exports);
39
39
  __exportStar(require("./board-column-type.enum"), exports);
40
40
  __exportStar(require("./board-activity.enum"), exports);
41
+ __exportStar(require("./user-agent.enum"), exports);
@@ -0,0 +1,22 @@
1
+ export declare enum UserAgentDevice {
2
+ DESKTOP = "desktop",
3
+ MOBILE = "mobile",
4
+ TABLET = "tablet",
5
+ UNKNOWN = "unknown"
6
+ }
7
+ export declare enum UserAgentBrowser {
8
+ CHROME = "Chrome",
9
+ FIREFOX = "Firefox",
10
+ SAFARI = "Safari",
11
+ EDGE = "Edge",
12
+ OPERA = "Opera",
13
+ UNKNOWN = "Unknown"
14
+ }
15
+ export declare enum UserAgentOS {
16
+ WINDOWS = "Windows",
17
+ MACOS = "MacOS",
18
+ LINUX = "Linux",
19
+ ANDROID = "Android",
20
+ IOS = "iOS",
21
+ UNKNOWN = "Unknown"
22
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserAgentOS = exports.UserAgentBrowser = exports.UserAgentDevice = void 0;
4
+ var UserAgentDevice;
5
+ (function (UserAgentDevice) {
6
+ UserAgentDevice["DESKTOP"] = "desktop";
7
+ UserAgentDevice["MOBILE"] = "mobile";
8
+ UserAgentDevice["TABLET"] = "tablet";
9
+ UserAgentDevice["UNKNOWN"] = "unknown";
10
+ })(UserAgentDevice || (exports.UserAgentDevice = UserAgentDevice = {}));
11
+ var UserAgentBrowser;
12
+ (function (UserAgentBrowser) {
13
+ UserAgentBrowser["CHROME"] = "Chrome";
14
+ UserAgentBrowser["FIREFOX"] = "Firefox";
15
+ UserAgentBrowser["SAFARI"] = "Safari";
16
+ UserAgentBrowser["EDGE"] = "Edge";
17
+ UserAgentBrowser["OPERA"] = "Opera";
18
+ UserAgentBrowser["UNKNOWN"] = "Unknown";
19
+ })(UserAgentBrowser || (exports.UserAgentBrowser = UserAgentBrowser = {}));
20
+ var UserAgentOS;
21
+ (function (UserAgentOS) {
22
+ UserAgentOS["WINDOWS"] = "Windows";
23
+ UserAgentOS["MACOS"] = "MacOS";
24
+ UserAgentOS["LINUX"] = "Linux";
25
+ UserAgentOS["ANDROID"] = "Android";
26
+ UserAgentOS["IOS"] = "iOS";
27
+ UserAgentOS["UNKNOWN"] = "Unknown";
28
+ })(UserAgentOS || (exports.UserAgentOS = UserAgentOS = {}));
@@ -41,9 +41,11 @@ export * from './requests/retrospective.public.request';
41
41
  export * from './requests/atlas.request';
42
42
  export * from './requests/atlas-page.request';
43
43
  export * from './requests/atlas-group.request';
44
+ export * from './requests/atlas-document.request';
44
45
  export * from './requests/atlas.public.request';
45
46
  export * from './requests/memo.request';
46
47
  export * from './requests/short-link.request';
48
+ export * from './requests/short-link.public.request';
47
49
  export * from './requests/short-link.admin.request';
48
50
  export * from './responses/auth.response';
49
51
  export * from './responses/user.response';
@@ -86,7 +88,9 @@ export * from './responses/retrospective.public.response';
86
88
  export * from './responses/atlas.response';
87
89
  export * from './responses/atlas-page.response';
88
90
  export * from './responses/atlas-group.response';
91
+ export * from './responses/atlas-document.response';
89
92
  export * from './responses/atlas.public.response';
90
93
  export * from './responses/memo.response';
91
94
  export * from './responses/short-link.response';
95
+ export * from './responses/short-link.public.response';
92
96
  export * from './responses/short-link.admin.response';
@@ -57,9 +57,11 @@ __exportStar(require("./requests/retrospective.public.request"), exports);
57
57
  __exportStar(require("./requests/atlas.request"), exports);
58
58
  __exportStar(require("./requests/atlas-page.request"), exports);
59
59
  __exportStar(require("./requests/atlas-group.request"), exports);
60
+ __exportStar(require("./requests/atlas-document.request"), exports);
60
61
  __exportStar(require("./requests/atlas.public.request"), exports);
61
62
  __exportStar(require("./requests/memo.request"), exports);
62
63
  __exportStar(require("./requests/short-link.request"), exports);
64
+ __exportStar(require("./requests/short-link.public.request"), exports);
63
65
  __exportStar(require("./requests/short-link.admin.request"), exports);
64
66
  __exportStar(require("./responses/auth.response"), exports);
65
67
  __exportStar(require("./responses/user.response"), exports);
@@ -102,7 +104,9 @@ __exportStar(require("./responses/retrospective.public.response"), exports);
102
104
  __exportStar(require("./responses/atlas.response"), exports);
103
105
  __exportStar(require("./responses/atlas-page.response"), exports);
104
106
  __exportStar(require("./responses/atlas-group.response"), exports);
107
+ __exportStar(require("./responses/atlas-document.response"), exports);
105
108
  __exportStar(require("./responses/atlas.public.response"), exports);
106
109
  __exportStar(require("./responses/memo.response"), exports);
107
110
  __exportStar(require("./responses/short-link.response"), exports);
111
+ __exportStar(require("./responses/short-link.public.response"), exports);
108
112
  __exportStar(require("./responses/short-link.admin.response"), exports);
@@ -0,0 +1,26 @@
1
+ import { QueryPaginate } from '..';
2
+ export type IGetUploadPreSignedUrlAtlasDocumentParams = {
3
+ atlasId: string;
4
+ atlasPageId: string;
5
+ };
6
+ export type IGetUploadPreSignedUrlAtlasDocumentBody = {
7
+ name: string;
8
+ };
9
+ export type IGetAtlasDocumentParams = {
10
+ atlasId: string;
11
+ atlasDocumentId: string;
12
+ };
13
+ export type IDeleteAtlasDocumentParams = {
14
+ atlasId: string;
15
+ atlasDocumentId: string;
16
+ };
17
+ export type IPaginateAtlasDocumentParams = {
18
+ atlasId: string;
19
+ };
20
+ export type IPaginateAtlasDocumentQuery = QueryPaginate & {
21
+ atlasPageId?: string;
22
+ };
23
+ export type IListAtlasDocumentParams = {
24
+ atlasId: string;
25
+ atlasPageId: string;
26
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -22,5 +22,8 @@ export type IUpdateShortLinkAdminBody = {
22
22
  isActive?: boolean;
23
23
  expiresAt?: Date | null;
24
24
  maxClicks?: number | null;
25
- password?: string | null;
26
25
  };
26
+ export type IGetClicksShortLinkAdminParams = {
27
+ shortLinkId: string;
28
+ };
29
+ export type IGetClicksShortLinkAdminQuery = QueryPaginate;
@@ -0,0 +1,33 @@
1
+ import { QueryPaginate } from '../type-message/base-paginate';
2
+ export type ICreateAnonymousShortLinkPublicBody = {
3
+ originalUrl: string;
4
+ title?: string;
5
+ description?: string;
6
+ };
7
+ export type IRedirectShortLinkPublicParams = {
8
+ slug: string;
9
+ };
10
+ export type IRedirectShortLinkPublicQuery = {
11
+ ref?: string;
12
+ lang?: string;
13
+ utmSource?: string;
14
+ utmMedium?: string;
15
+ utmCampaign?: string;
16
+ utmTerm?: string;
17
+ utmContent?: string;
18
+ };
19
+ export type IGetStatsShortLinkPublicParams = {
20
+ shortLinkId: string;
21
+ };
22
+ export type IGetStatsShortLinkPublicQuery = {
23
+ startDate?: Date;
24
+ endDate?: Date;
25
+ groupBy?: 'day' | 'week' | 'month';
26
+ };
27
+ export type IGetClicksShortLinkPublicParams = {
28
+ shortLinkId: string;
29
+ };
30
+ export type IGetClicksShortLinkPublicQuery = QueryPaginate;
31
+ export type IRenewShortLinkPublicParams = {
32
+ shortLinkId: string;
33
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,37 +2,19 @@ import { QueryPaginate } from '../type-message/base-paginate';
2
2
  export type IGetShortLinkParams = {
3
3
  shortLinkId: string;
4
4
  };
5
- export type IGetShortLinkBySlugParams = {
6
- slug: string;
7
- };
8
- export type IValidateShortLinkPasswordBody = {
9
- password: string;
10
- };
11
5
  export type IPaginateShortLinkQuery = {
12
- title?: string;
13
- userId?: string;
14
- projectId?: string;
15
- isActive?: boolean;
16
- } & QueryPaginate;
17
- export type IPaginateUserShortLinkQuery = {
18
6
  title?: string;
19
7
  isActive?: boolean;
20
8
  } & QueryPaginate;
21
9
  export type IPaginateProjectShortLinkParams = {
22
10
  projectId: string;
23
11
  };
24
- export type IPaginateProjectShortLinkQuery = {
25
- title?: string;
26
- isActive?: boolean;
27
- } & QueryPaginate;
28
12
  export type ICreateShortLinkBody = {
29
13
  originalUrl: string;
30
- slug?: string;
31
14
  title?: string;
32
15
  description?: string;
33
16
  expiresAt?: Date;
34
17
  maxClicks?: number;
35
- password?: string;
36
18
  };
37
19
  export type ICreateForProjectShortLinkParams = {
38
20
  projectId: string;
@@ -42,25 +24,24 @@ export type IUpdateShortLinkParams = {
42
24
  };
43
25
  export type IUpdateShortLinkBody = {
44
26
  originalUrl?: string;
45
- slug?: string;
46
27
  title?: string;
47
28
  description?: string;
48
29
  isActive?: boolean;
49
30
  expiresAt?: Date | null;
50
31
  maxClicks?: number | null;
51
- password?: string | null;
52
32
  };
53
33
  export type IDeleteShortLinkParams = {
54
34
  shortLinkId: string;
55
35
  };
56
- export type IGetShortLinkStatsParams = {
36
+ export type IGetStatsShortLinkParams = {
57
37
  shortLinkId: string;
58
38
  };
59
- export type IGetShortLinkStatsQuery = {
60
- startDate?: string;
61
- endDate?: string;
39
+ export type IGetStatsShortLinkQuery = {
40
+ startDate?: Date;
41
+ endDate?: Date;
62
42
  groupBy?: 'day' | 'week' | 'month';
63
43
  };
64
- export type IRedirectShortLinkParams = {
65
- slug: string;
44
+ export type IGetClicksShortLinkParams = {
45
+ shortLinkId: string;
66
46
  };
47
+ export type IGetClicksShortLinkQuery = QueryPaginate;
@@ -0,0 +1,18 @@
1
+ import { IResponse, BasePaginate } from '..';
2
+ import { IAtlasDocument } from '../..';
3
+ export interface IGetAtlasDocumentData {
4
+ atlasDocument: IAtlasDocument;
5
+ }
6
+ export type IGetAtlasDocumentResponse = IResponse<IGetAtlasDocumentData>;
7
+ export interface IGetUploadPreSignedUrlAtlasDocumentData {
8
+ preSignedUrl: string;
9
+ }
10
+ export type IGetUploadPreSignedUrlAtlasDocumentResponse = IResponse<IGetUploadPreSignedUrlAtlasDocumentData>;
11
+ export interface IDeleteAtlasDocumentData {
12
+ }
13
+ export type IDeleteAtlasDocumentResponse = IResponse<IDeleteAtlasDocumentData>;
14
+ export type IPaginateAtlasDocumentResponse = IResponse<BasePaginate<IAtlasDocument>>;
15
+ export interface IListAtlasDocumentData {
16
+ atlasDocuments: IAtlasDocument[];
17
+ }
18
+ export type IListAtlasDocumentResponse = IResponse<IListAtlasDocumentData>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
1
  import { BasePaginate, IResponse } from '..';
2
2
  import { IShortLink } from '../../models/short-link.model';
3
+ import { IShortLinkClick } from '../../models/short-link-click.model';
3
4
  export type IPaginateShortLinkAdminResponse = IResponse<BasePaginate<IShortLink>>;
4
5
  export interface IGetShortLinkAdminData {
5
6
  shortLink: IShortLink;
@@ -12,3 +13,4 @@ export interface IUpdateShortLinkAdminData {
12
13
  shortLink: IShortLink;
13
14
  }
14
15
  export type IUpdateShortLinkAdminResponse = IResponse<IUpdateShortLinkAdminData>;
16
+ export type IGetClicksShortLinkAdminResponse = IResponse<BasePaginate<IShortLinkClick>>;
@@ -0,0 +1,20 @@
1
+ import { BasePaginate, IResponse } from '..';
2
+ import { IShortLink, IShortLinkWithStats } from '../../models/short-link.model';
3
+ import { IShortLinkClick } from '../../models/short-link-click.model';
4
+ export interface ICreateShortLinkPublicData {
5
+ shortLink: IShortLink;
6
+ }
7
+ export type ICreateShortLinkPublicResponse = IResponse<ICreateShortLinkPublicData>;
8
+ export interface IRedirectShortLinkPublicData {
9
+ url: string;
10
+ }
11
+ export type IRedirectShortLinkPublicResponse = IResponse<IRedirectShortLinkPublicData>;
12
+ export interface IGetStatsShortLinkPublicData {
13
+ shortLink: IShortLinkWithStats;
14
+ }
15
+ export type IGetStatsShortLinkPublicResponse = IResponse<IGetStatsShortLinkPublicData>;
16
+ export interface IRenewShortLinkPublicData {
17
+ shortLink: IShortLink;
18
+ }
19
+ export type IRenewShortLinkPublicResponse = IResponse<IRenewShortLinkPublicData>;
20
+ export type IGetClicksShortLinkPublicResponse = IResponse<BasePaginate<IShortLinkClick>>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,18 +1,10 @@
1
1
  import { BasePaginate, IResponse } from '..';
2
2
  import { IShortLink, IShortLinkWithStats } from '../../models/short-link.model';
3
+ import { IShortLinkClick } from '../../models/short-link-click.model';
3
4
  export interface IGetShortLinkData {
4
5
  shortLink: IShortLink;
5
6
  }
6
7
  export type IGetShortLinkResponse = IResponse<IGetShortLinkData>;
7
- export interface IGetShortLinkBySlugData {
8
- shortLink: IShortLink;
9
- requiresPassword: boolean;
10
- }
11
- export type IGetShortLinkBySlugResponse = IResponse<IGetShortLinkBySlugData>;
12
- export interface IValidateShortLinkPasswordData {
13
- valid: boolean;
14
- }
15
- export type IValidateShortLinkPasswordResponse = IResponse<IValidateShortLinkPasswordData>;
16
8
  export type IPaginateShortLinkResponse = IResponse<BasePaginate<IShortLink>>;
17
9
  export interface ICreateShortLinkData {
18
10
  shortLink: IShortLink;
@@ -25,11 +17,8 @@ export type IUpdateShortLinkResponse = IResponse<IUpdateShortLinkData>;
25
17
  export interface IDeleteShortLinkData {
26
18
  }
27
19
  export type IDeleteShortLinkResponse = IResponse<IDeleteShortLinkData>;
28
- export interface IGetShortLinkStatsData {
20
+ export interface IGetStatsShortLinkData {
29
21
  shortLink: IShortLinkWithStats;
30
22
  }
31
- export type IGetShortLinkStatsResponse = IResponse<IGetShortLinkStatsData>;
32
- export interface IRedirectShortLinkData {
33
- url: string;
34
- }
35
- export type IRedirectShortLinkResponse = IResponse<IRedirectShortLinkData>;
23
+ export type IGetStatsShortLinkResponse = IResponse<IGetStatsShortLinkData>;
24
+ export type IGetClicksShortLinkResponse = IResponse<BasePaginate<IShortLinkClick>>;
@@ -39,6 +39,7 @@ export * from './models/atlas.model';
39
39
  export * from './models/atlas-group.model';
40
40
  export * from './models/atlas-page.model';
41
41
  export * from './models/atlas-page-content.model';
42
+ export * from './models/atlas-document.model';
42
43
  export * from './models/memo.model';
43
44
  export * from './models/short-link.model';
44
45
  export * from './models/short-link-click.model';
@@ -55,6 +55,7 @@ __exportStar(require("./models/atlas.model"), exports);
55
55
  __exportStar(require("./models/atlas-group.model"), exports);
56
56
  __exportStar(require("./models/atlas-page.model"), exports);
57
57
  __exportStar(require("./models/atlas-page-content.model"), exports);
58
+ __exportStar(require("./models/atlas-document.model"), exports);
58
59
  __exportStar(require("./models/memo.model"), exports);
59
60
  __exportStar(require("./models/short-link.model"), exports);
60
61
  __exportStar(require("./models/short-link-click.model"), exports);
@@ -0,0 +1,19 @@
1
+ import { IAtlasPage } from './atlas-page.model';
2
+ import { IAtlas } from './atlas.model';
3
+ export interface IAtlasDocument {
4
+ id: string;
5
+ atlasPageId: string;
6
+ atlasId: string;
7
+ name: string;
8
+ externalId: string;
9
+ publicAccessId: string;
10
+ thumbnailId: string | null;
11
+ thumbnailPublicAccessId: string | null;
12
+ sizeOctet: number;
13
+ mimeType: string;
14
+ checksum: string;
15
+ createdAt?: Date;
16
+ updatedAt?: Date;
17
+ atlasPage?: IAtlasPage;
18
+ atlas?: IAtlas;
19
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
+ import { IAtlasDocument } from './atlas-document.model';
1
2
  import { IAtlasGroup } from './atlas-group.model';
2
3
  import { IAtlasPageContent } from './atlas-page-content.model';
3
4
  import { IAtlas } from './atlas.model';
@@ -18,4 +19,5 @@ export interface IAtlasPage {
18
19
  atlas?: IAtlas;
19
20
  atlasGroup?: IAtlasGroup | null;
20
21
  atlasPageContent?: IAtlasPageContent[];
22
+ atlasDocument?: IAtlasDocument[];
21
23
  }
@@ -1,3 +1,4 @@
1
+ import { IAtlasDocument } from './atlas-document.model';
1
2
  import { IAtlasGroup } from './atlas-group.model';
2
3
  import { IAtlasPage } from './atlas-page.model';
3
4
  import { IProject } from './project.model';
@@ -16,6 +17,7 @@ export interface IAtlas {
16
17
  project?: IProject | null;
17
18
  atlasGroup?: IAtlasGroup[];
18
19
  atlasPage?: IAtlasPage[];
20
+ atlasDocument?: IAtlasDocument[];
19
21
  }
20
22
  export interface IAtlasWithDetails extends IAtlas {
21
23
  atlasGroup: IAtlasGroup[];
@@ -6,11 +6,23 @@ export interface IShortLinkClick {
6
6
  ipHash: string;
7
7
  userAgent: string | null;
8
8
  referer: string | null;
9
- country: string | null;
9
+ refererDomain: string | null;
10
+ countryCodeIso: string | null;
11
+ countryCode: string | null;
12
+ countryName: string | null;
13
+ continentCode: string | null;
10
14
  city: string | null;
11
15
  device: string | null;
12
16
  browser: string | null;
13
17
  os: string | null;
18
+ language: string | null;
19
+ utmSource: string | null;
20
+ utmMedium: string | null;
21
+ utmCampaign: string | null;
22
+ utmTerm: string | null;
23
+ utmContent: string | null;
24
+ isBotLikely: boolean;
25
+ isReturningVisitor: boolean;
14
26
  clickedAt: Date;
15
27
  createdAt?: Date;
16
28
  updatedAt?: Date;
@@ -33,6 +33,7 @@ export interface IShortLinkWithStats extends IShortLink {
33
33
  clicksByCountry: {
34
34
  country: string;
35
35
  clicks: number;
36
+ countryName: string;
36
37
  }[];
37
38
  clicksByDevice: {
38
39
  device: string;
@@ -46,5 +47,20 @@ export interface IShortLinkWithStats extends IShortLink {
46
47
  referer: string;
47
48
  clicks: number;
48
49
  }[];
50
+ clicksByUtmSource: {
51
+ utmSource: string;
52
+ clicks: number;
53
+ }[];
54
+ clicksByLanguage: {
55
+ language: string;
56
+ clicks: number;
57
+ }[];
58
+ clicksByRefererDomain: {
59
+ refererDomain: string;
60
+ clicks: number;
61
+ }[];
62
+ clicksLast24h: number;
63
+ returningVisitorsCount: number;
64
+ botClicksCount: number;
49
65
  };
50
66
  }
@@ -14,3 +14,6 @@ export * from './file.utils';
14
14
  export * from './compression.utils';
15
15
  export * from './shape.utils';
16
16
  export * from './icons.utils';
17
+ export * from './string.utils';
18
+ export * from './tracking.utils';
19
+ export * from './duration.utils';
@@ -30,3 +30,6 @@ __exportStar(require("./file.utils"), exports);
30
30
  __exportStar(require("./compression.utils"), exports);
31
31
  __exportStar(require("./shape.utils"), exports);
32
32
  __exportStar(require("./icons.utils"), exports);
33
+ __exportStar(require("./string.utils"), exports);
34
+ __exportStar(require("./tracking.utils"), exports);
35
+ __exportStar(require("./duration.utils"), exports);
@@ -0,0 +1,6 @@
1
+ import { UserAgentDevice, UserAgentBrowser, UserAgentOS } from '../types';
2
+ export declare function parseUserAgent(userAgent: string | undefined): {
3
+ device: UserAgentDevice;
4
+ browser: UserAgentBrowser;
5
+ os: UserAgentOS;
6
+ };
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseUserAgent = void 0;
4
+ const types_1 = require("../types");
5
+ function parseUserAgent(userAgent) {
6
+ if (!userAgent) {
7
+ return {
8
+ device: types_1.UserAgentDevice.UNKNOWN,
9
+ browser: types_1.UserAgentBrowser.UNKNOWN,
10
+ os: types_1.UserAgentOS.UNKNOWN,
11
+ };
12
+ }
13
+ const ua = userAgent.toLowerCase();
14
+ let device = types_1.UserAgentDevice.DESKTOP;
15
+ if (/(mobile|android|iphone|ipad|ipod)/i.test(ua)) {
16
+ device = types_1.UserAgentDevice.MOBILE;
17
+ }
18
+ else if (/(tablet|ipad)/i.test(ua)) {
19
+ device = types_1.UserAgentDevice.TABLET;
20
+ }
21
+ let browser = types_1.UserAgentBrowser.UNKNOWN;
22
+ if (ua.includes('chrome'))
23
+ browser = types_1.UserAgentBrowser.CHROME;
24
+ else if (ua.includes('firefox'))
25
+ browser = types_1.UserAgentBrowser.FIREFOX;
26
+ else if (ua.includes('safari'))
27
+ browser = types_1.UserAgentBrowser.SAFARI;
28
+ else if (ua.includes('edge'))
29
+ browser = types_1.UserAgentBrowser.EDGE;
30
+ else if (ua.includes('opera'))
31
+ browser = types_1.UserAgentBrowser.OPERA;
32
+ let os = types_1.UserAgentOS.UNKNOWN;
33
+ if (ua.includes('windows'))
34
+ os = types_1.UserAgentOS.WINDOWS;
35
+ else if (ua.includes('mac'))
36
+ os = types_1.UserAgentOS.MACOS;
37
+ else if (ua.includes('linux'))
38
+ os = types_1.UserAgentOS.LINUX;
39
+ else if (ua.includes('android'))
40
+ os = types_1.UserAgentOS.ANDROID;
41
+ else if (ua.includes('ios') || ua.includes('iphone') || ua.includes('ipad'))
42
+ os = types_1.UserAgentOS.IOS;
43
+ return { device, browser, os };
44
+ }
45
+ exports.parseUserAgent = parseUserAgent;
@@ -0,0 +1,11 @@
1
+ export declare const extractDomain: (url: string | null | undefined) => string | null;
2
+ export declare const detectBot: (userAgent: string | null | undefined) => boolean;
3
+ export declare const extractUTMParams: (searchParams: URLSearchParams | string) => {
4
+ utmSource?: string;
5
+ utmMedium?: string;
6
+ utmCampaign?: string;
7
+ utmTerm?: string;
8
+ utmContent?: string;
9
+ };
10
+ export declare const isLocalhost: (ipAddress: string | undefined) => boolean;
11
+ export declare const normalizeLanguage: (language: string | null | undefined) => string | null;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeLanguage = exports.isLocalhost = exports.extractUTMParams = exports.detectBot = exports.extractDomain = void 0;
4
+ const extractDomain = (url) => {
5
+ if (!url)
6
+ return null;
7
+ try {
8
+ const urlObj = new URL(url);
9
+ return urlObj.hostname;
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ };
15
+ exports.extractDomain = extractDomain;
16
+ const detectBot = (userAgent) => {
17
+ if (!userAgent)
18
+ return false;
19
+ const botPatterns = [
20
+ /bot/i,
21
+ /crawl/i,
22
+ /spider/i,
23
+ /curl/i,
24
+ /wget/i,
25
+ /python/i,
26
+ /java/i,
27
+ /http/i,
28
+ /scan/i,
29
+ /check/i,
30
+ /monitor/i,
31
+ /headless/i,
32
+ /phantom/i,
33
+ /selenium/i,
34
+ ];
35
+ return botPatterns.some((pattern) => pattern.test(userAgent));
36
+ };
37
+ exports.detectBot = detectBot;
38
+ const extractUTMParams = (searchParams) => {
39
+ const params = typeof searchParams === 'string' ? new URLSearchParams(searchParams) : searchParams;
40
+ return {
41
+ utmSource: params.get('utm_source') || undefined,
42
+ utmMedium: params.get('utm_medium') || undefined,
43
+ utmCampaign: params.get('utm_campaign') || undefined,
44
+ utmTerm: params.get('utm_term') || undefined,
45
+ utmContent: params.get('utm_content') || undefined,
46
+ };
47
+ };
48
+ exports.extractUTMParams = extractUTMParams;
49
+ const isLocalhost = (ipAddress) => {
50
+ if (!ipAddress)
51
+ return true;
52
+ return ipAddress === '127.0.0.1' || ipAddress === '::1' || ipAddress.startsWith('192.168.');
53
+ };
54
+ exports.isLocalhost = isLocalhost;
55
+ const normalizeLanguage = (language) => {
56
+ if (!language)
57
+ return null;
58
+ return language.split('-')[0].toLowerCase();
59
+ };
60
+ exports.normalizeLanguage = normalizeLanguage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/main",
3
- "version": "1.0.68",
3
+ "version": "1.0.71",
4
4
  "description": "Core package to interact with Abyss-Project",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",