@abyss-project/link 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +32 -0
- package/.prettierrc +5 -0
- package/README.md +21 -2
- package/dist/api/abyss.admin.api.d.ts +4 -0
- package/dist/api/abyss.admin.api.js +17 -0
- package/dist/api/abyss.admin.api.js.map +1 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/link.admin.api.d.ts +14 -0
- package/dist/api/link.admin.api.js +64 -0
- package/dist/api/link.admin.api.js.map +1 -0
- package/dist/api/link.api.d.ts +15 -0
- package/dist/api/link.api.js +69 -0
- package/dist/api/link.api.js.map +1 -0
- package/dist/api/link.public.api.d.ts +2 -0
- package/dist/api/link.public.api.js +9 -0
- package/dist/api/link.public.api.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/link.constants.d.ts +25 -0
- package/dist/constants/link.constants.js +48 -0
- package/dist/constants/link.constants.js.map +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +157 -0
- package/dist/index.js.map +1 -0
- package/dist/types/enum/api-error.enum.d.ts +24 -0
- package/dist/types/enum/api-error.enum.js +30 -0
- package/dist/types/enum/api-error.enum.js.map +1 -0
- package/dist/types/enum/index.d.ts +4 -0
- package/dist/types/enum/index.js +21 -0
- package/dist/types/enum/index.js.map +1 -0
- package/dist/types/enum/link-share.enum.d.ts +11 -0
- package/dist/types/enum/link-share.enum.js +17 -0
- package/dist/types/enum/link-share.enum.js.map +1 -0
- package/dist/types/enum/link-stats.enum.d.ts +5 -0
- package/dist/types/enum/link-stats.enum.js +10 -0
- package/dist/types/enum/link-stats.enum.js.map +1 -0
- package/dist/types/enum/link.enum.d.ts +20 -0
- package/dist/types/enum/link.enum.js +27 -0
- package/dist/types/enum/link.enum.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +19 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interface/api/index.d.ts +5 -0
- package/dist/types/interface/api/index.js +22 -0
- package/dist/types/interface/api/index.js.map +1 -0
- package/dist/types/interface/api/requests/abyss.admin.request.d.ts +14 -0
- package/dist/types/interface/api/requests/abyss.admin.request.js +3 -0
- package/dist/types/interface/api/requests/abyss.admin.request.js.map +1 -0
- package/dist/types/interface/api/requests/index.d.ts +4 -0
- package/dist/types/interface/api/requests/index.js +21 -0
- package/dist/types/interface/api/requests/index.js.map +1 -0
- package/dist/types/interface/api/requests/link.admin.request.d.ts +69 -0
- package/dist/types/interface/api/requests/link.admin.request.js +3 -0
- package/dist/types/interface/api/requests/link.admin.request.js.map +1 -0
- package/dist/types/interface/api/requests/link.public.request.d.ts +13 -0
- package/dist/types/interface/api/requests/link.public.request.js +3 -0
- package/dist/types/interface/api/requests/link.public.request.js.map +1 -0
- package/dist/types/interface/api/requests/link.request.d.ts +74 -0
- package/dist/types/interface/api/requests/link.request.js +3 -0
- package/dist/types/interface/api/requests/link.request.js.map +1 -0
- package/dist/types/interface/api/responses/abyss.admin.response.d.ts +14 -0
- package/dist/types/interface/api/responses/abyss.admin.response.js +3 -0
- package/dist/types/interface/api/responses/abyss.admin.response.js.map +1 -0
- package/dist/types/interface/api/responses/index.d.ts +4 -0
- package/dist/types/interface/api/responses/index.js +21 -0
- package/dist/types/interface/api/responses/index.js.map +1 -0
- package/dist/types/interface/api/responses/link.admin.response.d.ts +43 -0
- package/dist/types/interface/api/responses/link.admin.response.js +3 -0
- package/dist/types/interface/api/responses/link.admin.response.js.map +1 -0
- package/dist/types/interface/api/responses/link.public.response.d.ts +5 -0
- package/dist/types/interface/api/responses/link.public.response.js +3 -0
- package/dist/types/interface/api/responses/link.public.response.js.map +1 -0
- package/dist/types/interface/api/responses/link.response.d.ts +43 -0
- package/dist/types/interface/api/responses/link.response.js +3 -0
- package/dist/types/interface/api/responses/link.response.js.map +1 -0
- package/dist/types/interface/api/type-message/api-error.d.ts +6 -0
- package/dist/types/interface/api/type-message/api-error.js +3 -0
- package/dist/types/interface/api/type-message/api-error.js.map +1 -0
- package/dist/types/interface/api/type-message/base-paginate.d.ts +10 -0
- package/dist/types/interface/api/type-message/base-paginate.js +3 -0
- package/dist/types/interface/api/type-message/base-paginate.js.map +1 -0
- package/dist/types/interface/api/type-message/response.d.ts +5 -0
- package/dist/types/interface/api/type-message/response.js +3 -0
- package/dist/types/interface/api/type-message/response.js.map +1 -0
- package/dist/types/interface/index.d.ts +2 -0
- package/dist/types/interface/index.js +19 -0
- package/dist/types/interface/index.js.map +1 -0
- package/dist/types/interface/models/index.d.ts +5 -0
- package/dist/types/interface/models/index.js +22 -0
- package/dist/types/interface/models/index.js.map +1 -0
- package/dist/types/interface/models/link-list.dto.d.ts +20 -0
- package/dist/types/interface/models/link-list.dto.js +3 -0
- package/dist/types/interface/models/link-list.dto.js.map +1 -0
- package/dist/types/interface/models/link.dto.d.ts +91 -0
- package/dist/types/interface/models/link.dto.js +3 -0
- package/dist/types/interface/models/link.dto.js.map +1 -0
- package/dist/types/interface/models/organization.dto.d.ts +11 -0
- package/dist/types/interface/models/organization.dto.js +3 -0
- package/dist/types/interface/models/organization.dto.js.map +1 -0
- package/dist/types/interface/models/project.dto.d.ts +12 -0
- package/dist/types/interface/models/project.dto.js +3 -0
- package/dist/types/interface/models/project.dto.js.map +1 -0
- package/dist/types/interface/models/user.dto.d.ts +11 -0
- package/dist/types/interface/models/user.dto.js +3 -0
- package/dist/types/interface/models/user.dto.js.map +1 -0
- package/dist/utils/enum.utils.d.ts +1 -0
- package/dist/utils/enum.utils.js +3 -0
- package/dist/utils/enum.utils.js.map +1 -0
- package/dist/utils/error.utils.d.ts +15 -0
- package/dist/utils/error.utils.js +25 -0
- package/dist/utils/error.utils.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/link-slug.utils.d.ts +1 -0
- package/dist/utils/link-slug.utils.js +11 -0
- package/dist/utils/link-slug.utils.js.map +1 -0
- package/jest.config.cjs +9 -0
- package/package.json +62 -4
- package/src/api/abyss.admin.api.ts +39 -0
- package/src/api/index.ts +4 -0
- package/src/api/link.admin.api.ts +168 -0
- package/src/api/link.api.ts +158 -0
- package/src/api/link.public.api.ts +19 -0
- package/src/constants/index.ts +1 -0
- package/src/constants/link.constants.ts +66 -0
- package/src/constants/tests/link-forbidden-slugs.spec.ts +103 -0
- package/src/index.ts +180 -0
- package/src/tests/link-public-api.spec.ts +37 -0
- package/src/tests/link-sdk-surface.spec.ts +191 -0
- package/src/tests/sdk-surface.spec.ts +63 -0
- package/src/types/enum/api-error.enum.ts +31 -0
- package/src/types/enum/index.ts +4 -0
- package/src/types/enum/link-share.enum.ts +17 -0
- package/src/types/enum/link-stats.enum.ts +6 -0
- package/src/types/enum/link.enum.ts +34 -0
- package/src/types/index.ts +2 -0
- package/src/types/interface/api/index.ts +5 -0
- package/src/types/interface/api/requests/abyss.admin.request.ts +17 -0
- package/src/types/interface/api/requests/index.ts +4 -0
- package/src/types/interface/api/requests/link.admin.request.ts +104 -0
- package/src/types/interface/api/requests/link.public.request.ts +18 -0
- package/src/types/interface/api/requests/link.request.ts +100 -0
- package/src/types/interface/api/responses/abyss.admin.response.ts +17 -0
- package/src/types/interface/api/responses/index.ts +4 -0
- package/src/types/interface/api/responses/link.admin.response.ts +56 -0
- package/src/types/interface/api/responses/link.public.response.ts +7 -0
- package/src/types/interface/api/responses/link.response.ts +55 -0
- package/src/types/interface/api/type-message/api-error.ts +7 -0
- package/src/types/interface/api/type-message/base-paginate.ts +11 -0
- package/src/types/interface/api/type-message/response.ts +6 -0
- package/src/types/interface/index.ts +2 -0
- package/src/types/interface/models/index.ts +5 -0
- package/src/types/interface/models/link-list.dto.ts +28 -0
- package/src/types/interface/models/link.dto.ts +117 -0
- package/src/types/interface/models/organization.dto.ts +21 -0
- package/src/types/interface/models/project.dto.ts +16 -0
- package/src/types/interface/models/user.dto.ts +19 -0
- package/src/types/tests/link-enums.spec.ts +48 -0
- package/src/utils/enum.utils.ts +1 -0
- package/src/utils/error.utils.ts +30 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/link-slug.utils.ts +10 -0
- package/tsconfig.check.json +15 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LinkShareScope } from '../../../enum/link-share.enum';
|
|
2
|
+
import { LinkStatsGranularity } from '../../../enum/link-stats.enum';
|
|
3
|
+
import { ILinkOrigin } from '../../models/link.dto';
|
|
4
|
+
import { QueryPaginate } from '../type-message/base-paginate';
|
|
5
|
+
export interface ILinkIdParams {
|
|
6
|
+
linkId: string;
|
|
7
|
+
}
|
|
8
|
+
export type IGetLinkParams = ILinkIdParams;
|
|
9
|
+
export type IUpdateLinkParams = ILinkIdParams;
|
|
10
|
+
export type IDeleteLinkParams = ILinkIdParams;
|
|
11
|
+
export type ITransferLinkParams = ILinkIdParams;
|
|
12
|
+
export type IGetLinkStatsParams = ILinkIdParams;
|
|
13
|
+
export type IGetLinkVisitsParams = ILinkIdParams;
|
|
14
|
+
export interface IPaginateLinkQuery extends QueryPaginate {
|
|
15
|
+
search?: string;
|
|
16
|
+
isActive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IPaginateProjectLinkParams {
|
|
19
|
+
projectId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IPaginateOrganizationLinkParams {
|
|
22
|
+
organizationId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IPaginateOrganizationLinkQuery extends IPaginateLinkQuery {
|
|
25
|
+
scope?: LinkShareScope;
|
|
26
|
+
teamId?: string;
|
|
27
|
+
projectId?: string;
|
|
28
|
+
adminView?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ICountOrganizationLinkParams {
|
|
31
|
+
organizationId: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ICountOrganizationLinkQuery {
|
|
34
|
+
adminView?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ICreateLinkBody {
|
|
37
|
+
targetUrl: string;
|
|
38
|
+
slug?: string;
|
|
39
|
+
password?: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
expiresAt?: Date | string;
|
|
43
|
+
maxClicks?: number;
|
|
44
|
+
forwardCampaignParams?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface ICreateForOrganizationLinkParams {
|
|
47
|
+
organizationId: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ICreateForOrganizationLinkBody extends ICreateLinkBody {
|
|
50
|
+
projectId?: string;
|
|
51
|
+
scope?: 'USER';
|
|
52
|
+
}
|
|
53
|
+
export interface IUpdateLinkBody {
|
|
54
|
+
targetUrl?: string;
|
|
55
|
+
slug?: string;
|
|
56
|
+
password?: string | null;
|
|
57
|
+
title?: string | null;
|
|
58
|
+
description?: string | null;
|
|
59
|
+
isActive?: boolean;
|
|
60
|
+
expiresAt?: Date | string | null;
|
|
61
|
+
maxClicks?: number | null;
|
|
62
|
+
forwardCampaignParams?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface ITransferLinkBody {
|
|
65
|
+
newOwnerId: string;
|
|
66
|
+
}
|
|
67
|
+
export interface IGetLinkStatsQuery {
|
|
68
|
+
from?: Date | string;
|
|
69
|
+
to?: Date | string;
|
|
70
|
+
granularity?: LinkStatsGranularity;
|
|
71
|
+
}
|
|
72
|
+
export type IGetLinkVisitsQuery = QueryPaginate;
|
|
73
|
+
export type IGetByOriginLinkQuery = ILinkOrigin;
|
|
74
|
+
export type IGetStatsByOriginLinkQuery = ILinkOrigin & IGetLinkStatsQuery;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.request.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/requests/link.request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IUser, IOrganization, IProject } from '../..';
|
|
2
|
+
import { IResponse } from '../type-message/response';
|
|
3
|
+
export interface IActivateUserServiceAbyssAdminData {
|
|
4
|
+
user: IUser;
|
|
5
|
+
}
|
|
6
|
+
export type IActivateUserServiceAbyssAdminResponse = IResponse<IActivateUserServiceAbyssAdminData>;
|
|
7
|
+
export interface ISyncOrganizationAbyssAdminData {
|
|
8
|
+
organization: IOrganization;
|
|
9
|
+
}
|
|
10
|
+
export type ISyncOrganizationAbyssAdminResponse = IResponse<ISyncOrganizationAbyssAdminData>;
|
|
11
|
+
export interface ISyncProjectAbyssAdminData {
|
|
12
|
+
project: IProject;
|
|
13
|
+
}
|
|
14
|
+
export type ISyncProjectAbyssAdminResponse = IResponse<ISyncProjectAbyssAdminData>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abyss.admin.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/abyss.admin.response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./abyss.admin.response"), exports);
|
|
18
|
+
__exportStar(require("./link.response"), exports);
|
|
19
|
+
__exportStar(require("./link.admin.response"), exports);
|
|
20
|
+
__exportStar(require("./link.public.response"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,kDAAgC;AAChC,wDAAsC;AACtC,yDAAuC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ILink, ILinkStats, ILinkVisit } from '../../models/link.dto';
|
|
2
|
+
import { ILinkCampaignStatsRow } from '../../models/link-list.dto';
|
|
3
|
+
import { BasePaginate } from '../type-message/base-paginate';
|
|
4
|
+
import { IResponse } from '../type-message/response';
|
|
5
|
+
export type IPaginateLinkAdminData = BasePaginate<ILink>;
|
|
6
|
+
export type IPaginateLinkAdminResponse = IResponse<IPaginateLinkAdminData>;
|
|
7
|
+
export interface IGetLinkAdminData {
|
|
8
|
+
link: ILink;
|
|
9
|
+
}
|
|
10
|
+
export type IGetLinkAdminResponse = IResponse<IGetLinkAdminData>;
|
|
11
|
+
export type IGetVisitsLinkAdminData = BasePaginate<ILinkVisit>;
|
|
12
|
+
export type IGetVisitsLinkAdminResponse = IResponse<IGetVisitsLinkAdminData>;
|
|
13
|
+
export interface IGetCampaignStatsLinkAdminData {
|
|
14
|
+
rows: ILinkCampaignStatsRow[];
|
|
15
|
+
}
|
|
16
|
+
export type IGetCampaignStatsLinkAdminResponse = IResponse<IGetCampaignStatsLinkAdminData>;
|
|
17
|
+
export interface ISetProtectionLinkAdminData {
|
|
18
|
+
link: ILink;
|
|
19
|
+
}
|
|
20
|
+
export type ISetProtectionLinkAdminResponse = IResponse<ISetProtectionLinkAdminData>;
|
|
21
|
+
export interface IUpdateLinkAdminData {
|
|
22
|
+
link: ILink;
|
|
23
|
+
}
|
|
24
|
+
export type IUpdateLinkAdminResponse = IResponse<IUpdateLinkAdminData>;
|
|
25
|
+
export type IDeleteLinkAdminResponse = IResponse<Record<string, never>>;
|
|
26
|
+
export interface ICreateLinkAdminData {
|
|
27
|
+
link: ILink;
|
|
28
|
+
}
|
|
29
|
+
export type ICreateLinkAdminResponse = IResponse<ICreateLinkAdminData>;
|
|
30
|
+
export interface IGetByOriginLinkAdminData {
|
|
31
|
+
link: ILink;
|
|
32
|
+
}
|
|
33
|
+
export type IGetByOriginLinkAdminResponse = IResponse<IGetByOriginLinkAdminData>;
|
|
34
|
+
export interface IGetStatsByOriginLinkAdminData {
|
|
35
|
+
stats: ILinkStats;
|
|
36
|
+
}
|
|
37
|
+
export type IGetStatsByOriginLinkAdminResponse = IResponse<IGetStatsByOriginLinkAdminData>;
|
|
38
|
+
export type IRecordCampaignViewLinkAdminResponse = IResponse<Record<string, never>>;
|
|
39
|
+
export interface IListCampaignTokensLinkAdminData {
|
|
40
|
+
links: ILink[];
|
|
41
|
+
}
|
|
42
|
+
export type IListCampaignTokensLinkAdminResponse = IResponse<IListCampaignTokensLinkAdminData>;
|
|
43
|
+
export type IDeleteCampaignTokenLinkAdminResponse = IResponse<Record<string, never>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.admin.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/link.admin.response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.public.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/link.public.response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ILink, ILinkStats, ILinkVisit } from '../../models/link.dto';
|
|
2
|
+
import { ILinkListItem } from '../../models/link-list.dto';
|
|
3
|
+
import { BasePaginate } from '../type-message/base-paginate';
|
|
4
|
+
import { IResponse } from '../type-message/response';
|
|
5
|
+
export interface IGetLinkData {
|
|
6
|
+
link: ILink;
|
|
7
|
+
}
|
|
8
|
+
export type IGetLinkResponse = IResponse<IGetLinkData>;
|
|
9
|
+
export type IPaginateLinkData = BasePaginate<ILinkListItem>;
|
|
10
|
+
export type IPaginateLinkResponse = IResponse<IPaginateLinkData>;
|
|
11
|
+
export interface ICountOrganizationLinkData {
|
|
12
|
+
total: number;
|
|
13
|
+
orphan?: number;
|
|
14
|
+
unshared?: number;
|
|
15
|
+
}
|
|
16
|
+
export type ICountOrganizationLinkResponse = IResponse<ICountOrganizationLinkData>;
|
|
17
|
+
export interface ICreateLinkData {
|
|
18
|
+
link: ILink;
|
|
19
|
+
}
|
|
20
|
+
export type ICreateLinkResponse = IResponse<ICreateLinkData>;
|
|
21
|
+
export interface IUpdateLinkData {
|
|
22
|
+
link: ILink;
|
|
23
|
+
}
|
|
24
|
+
export type IUpdateLinkResponse = IResponse<IUpdateLinkData>;
|
|
25
|
+
export type IDeleteLinkResponse = IResponse<Record<string, never>>;
|
|
26
|
+
export interface ITransferLinkData {
|
|
27
|
+
link: ILink;
|
|
28
|
+
}
|
|
29
|
+
export type ITransferLinkResponse = IResponse<ITransferLinkData>;
|
|
30
|
+
export interface IGetLinkStatsData {
|
|
31
|
+
stats: ILinkStats;
|
|
32
|
+
}
|
|
33
|
+
export type IGetLinkStatsResponse = IResponse<IGetLinkStatsData>;
|
|
34
|
+
export type IGetLinkVisitsData = BasePaginate<ILinkVisit>;
|
|
35
|
+
export type IGetLinkVisitsResponse = IResponse<IGetLinkVisitsData>;
|
|
36
|
+
export interface IGetByOriginLinkData {
|
|
37
|
+
link: ILink;
|
|
38
|
+
}
|
|
39
|
+
export type IGetByOriginLinkResponse = IResponse<IGetByOriginLinkData>;
|
|
40
|
+
export interface IGetStatsByOriginLinkData {
|
|
41
|
+
stats: ILinkStats;
|
|
42
|
+
}
|
|
43
|
+
export type IGetStatsByOriginLinkResponse = IResponse<IGetStatsByOriginLinkData>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/responses/link.response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/type-message/api-error.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-paginate.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/type-message/base-paginate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../../../src/types/interface/api/type-message/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./models"), exports);
|
|
18
|
+
__exportStar(require("./api"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/interface/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wCAAsB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./user.dto"), exports);
|
|
18
|
+
__exportStar(require("./organization.dto"), exports);
|
|
19
|
+
__exportStar(require("./project.dto"), exports);
|
|
20
|
+
__exportStar(require("./link.dto"), exports);
|
|
21
|
+
__exportStar(require("./link-list.dto"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/interface/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,qDAAmC;AACnC,gDAA8B;AAC9B,6CAA2B;AAC3B,kDAAgC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LinkSharePermission } from '../../enum/link-share.enum';
|
|
2
|
+
import { ILink } from './link.dto';
|
|
3
|
+
export interface ILinkContentShare {
|
|
4
|
+
id: string;
|
|
5
|
+
targetType: string;
|
|
6
|
+
targetId: string | null;
|
|
7
|
+
permission: LinkSharePermission;
|
|
8
|
+
expiresAt: string | null;
|
|
9
|
+
createdByUserId: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface ILinkListItem extends ILink {
|
|
12
|
+
permission: LinkSharePermission;
|
|
13
|
+
shares: ILinkContentShare[];
|
|
14
|
+
}
|
|
15
|
+
export interface ILinkCampaignStatsRow {
|
|
16
|
+
utmCampaign: string | null;
|
|
17
|
+
utmMedium: string | null;
|
|
18
|
+
visits: number;
|
|
19
|
+
uniqueVisitors: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-list.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/link-list.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { LinkKind, LinkResourceProduct, LinkVisitSource } from '../../enum/link.enum';
|
|
2
|
+
import { IOrganization } from './organization.dto';
|
|
3
|
+
import { IProject } from './project.dto';
|
|
4
|
+
import { IUser } from './user.dto';
|
|
5
|
+
export interface ILinkOrigin {
|
|
6
|
+
service: LinkResourceProduct;
|
|
7
|
+
resourceType: string;
|
|
8
|
+
resourceId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ILink {
|
|
11
|
+
id: string;
|
|
12
|
+
kind: LinkKind;
|
|
13
|
+
slug: string | null;
|
|
14
|
+
slugKey: string | null;
|
|
15
|
+
prefix: string | null;
|
|
16
|
+
code: string | null;
|
|
17
|
+
token: string | null;
|
|
18
|
+
targetUrl: string;
|
|
19
|
+
title: string | null;
|
|
20
|
+
description: string | null;
|
|
21
|
+
userId: string | null;
|
|
22
|
+
projectId: string | null;
|
|
23
|
+
organizationId: string | null;
|
|
24
|
+
createdByUserId: string | null;
|
|
25
|
+
originService: LinkResourceProduct | null;
|
|
26
|
+
originResourceType: string | null;
|
|
27
|
+
originResourceId: string | null;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
expiresAt: Date | null;
|
|
30
|
+
maxClicks: number | null;
|
|
31
|
+
passwordHash: string | null;
|
|
32
|
+
forwardCampaignParams: boolean;
|
|
33
|
+
isProtected: boolean;
|
|
34
|
+
protectedAt: Date | null;
|
|
35
|
+
protectedByAdminId: string | null;
|
|
36
|
+
clickCount: number;
|
|
37
|
+
uniqueClickCount: number;
|
|
38
|
+
lastVisitedAt: Date | null;
|
|
39
|
+
createdAt?: Date;
|
|
40
|
+
updatedAt?: Date;
|
|
41
|
+
user?: IUser | null;
|
|
42
|
+
project?: IProject | null;
|
|
43
|
+
organization?: IOrganization | null;
|
|
44
|
+
}
|
|
45
|
+
export interface ILinkVisit {
|
|
46
|
+
id: string;
|
|
47
|
+
linkId: string;
|
|
48
|
+
visitedAt: Date;
|
|
49
|
+
source: LinkVisitSource;
|
|
50
|
+
visitorHash: string;
|
|
51
|
+
isBot: boolean;
|
|
52
|
+
isFirstOfDay: boolean;
|
|
53
|
+
country: string | null;
|
|
54
|
+
city: string | null;
|
|
55
|
+
device: string | null;
|
|
56
|
+
browser: string | null;
|
|
57
|
+
os: string | null;
|
|
58
|
+
language: string | null;
|
|
59
|
+
refererDomain: string | null;
|
|
60
|
+
utmSource: string | null;
|
|
61
|
+
utmMedium: string | null;
|
|
62
|
+
utmCampaign: string | null;
|
|
63
|
+
utmTerm: string | null;
|
|
64
|
+
utmContent: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface ILinkBreakdowns {
|
|
67
|
+
countries: Record<string, number>;
|
|
68
|
+
cities: Record<string, number>;
|
|
69
|
+
devices: Record<string, number>;
|
|
70
|
+
browsers: Record<string, number>;
|
|
71
|
+
oses: Record<string, number>;
|
|
72
|
+
languages: Record<string, number>;
|
|
73
|
+
refererDomains: Record<string, number>;
|
|
74
|
+
utmSources: Record<string, number>;
|
|
75
|
+
utmMediums: Record<string, number>;
|
|
76
|
+
utmCampaigns: Record<string, number>;
|
|
77
|
+
}
|
|
78
|
+
export interface ILinkDailyStats extends ILinkBreakdowns {
|
|
79
|
+
linkId: string;
|
|
80
|
+
day: string;
|
|
81
|
+
visits: number;
|
|
82
|
+
uniqueVisitors: number;
|
|
83
|
+
botVisits: number;
|
|
84
|
+
}
|
|
85
|
+
export interface ILinkStats extends ILinkBreakdowns {
|
|
86
|
+
visits: number;
|
|
87
|
+
uniqueVisitors: number;
|
|
88
|
+
botVisits: number;
|
|
89
|
+
lastVisitedAt: Date | null;
|
|
90
|
+
daily: ILinkDailyStats[];
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/link.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/organization.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IOrganization } from './organization.dto';
|
|
2
|
+
import { IUser } from './user.dto';
|
|
3
|
+
export interface IProject {
|
|
4
|
+
id?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
createdByUserId: string | null;
|
|
7
|
+
organizationId: string;
|
|
8
|
+
updatedAt?: Date;
|
|
9
|
+
createdAt?: Date;
|
|
10
|
+
organization?: IOrganization;
|
|
11
|
+
user?: IUser;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/project.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IProject } from './project.dto';
|
|
2
|
+
export interface IUser {
|
|
3
|
+
id?: string;
|
|
4
|
+
isAdmin: boolean;
|
|
5
|
+
personalApiKeyLookupHash?: string | null;
|
|
6
|
+
personalApiKeyRevokedAt?: Date | null;
|
|
7
|
+
accountDeletedAt?: Date | null;
|
|
8
|
+
updatedAt?: Date;
|
|
9
|
+
createdAt?: Date;
|
|
10
|
+
projects?: IProject[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.dto.js","sourceRoot":"","sources":["../../../../src/types/interface/models/user.dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ValueOf<T> = T[keyof T];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.utils.js","sourceRoot":"","sources":["../../src/utils/enum.utils.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Code, ErrorType } from '../types';
|
|
2
|
+
type ErrorParams = {
|
|
3
|
+
code: Code;
|
|
4
|
+
type: ErrorType;
|
|
5
|
+
message?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class ServiceException extends Error {
|
|
8
|
+
private readonly code;
|
|
9
|
+
private readonly type;
|
|
10
|
+
getCode(): Code;
|
|
11
|
+
getType(): ErrorType;
|
|
12
|
+
constructor(params: ErrorParams);
|
|
13
|
+
}
|
|
14
|
+
export declare const handleError: (error: Error | ErrorParams, _params?: ErrorParams) => Error;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleError = exports.ServiceException = void 0;
|
|
4
|
+
class ServiceException extends Error {
|
|
5
|
+
getCode() {
|
|
6
|
+
return this.code;
|
|
7
|
+
}
|
|
8
|
+
getType() {
|
|
9
|
+
return this.type;
|
|
10
|
+
}
|
|
11
|
+
constructor(params) {
|
|
12
|
+
super(params.message);
|
|
13
|
+
this.code = params.code;
|
|
14
|
+
this.type = params.type;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ServiceException = ServiceException;
|
|
18
|
+
const handleError = (error, _params) => {
|
|
19
|
+
if (error instanceof Error) {
|
|
20
|
+
return error;
|
|
21
|
+
}
|
|
22
|
+
return new ServiceException(error);
|
|
23
|
+
};
|
|
24
|
+
exports.handleError = handleError;
|
|
25
|
+
//# sourceMappingURL=error.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.utils.js","sourceRoot":"","sources":["../../src/utils/error.utils.ts"],"names":[],"mappings":";;;AAIA,MAAa,gBAAiB,SAAQ,KAAK;IAKzC,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;CACF;AAlBD,4CAkBC;AAEM,MAAM,WAAW,GAAG,CAAC,KAA0B,EAAE,OAAqB,EAAS,EAAE;IACtF,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AALW,QAAA,WAAW,eAKtB"}
|