ad2app-lib 1.0.3 → 1.0.4
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/dist/types/I_Campaign.d.ts +9 -9
- package/dist/types/I_Campaign.js +1 -1
- package/dist/types/I_CampaignDeadline.d.ts +2 -1
- package/dist/types/I_CampaignDeadline.js +2 -1
- package/dist/types/I_Collaboration.d.ts +32 -5
- package/dist/types/I_Collaboration.js +21 -3
- package/dist/types/I_Item.d.ts +2 -0
- package/dist/types/I_Item.js +11 -0
- package/dist/types/I_List.d.ts +2 -0
- package/dist/types/I_List.js +11 -0
- package/dist/types/I_Media.d.ts +2 -1
- package/package.json +1 -1
- package/src/types/I_Campaign.ts +11 -11
- package/src/types/I_CampaignDeadline.ts +5 -3
- package/src/types/I_Collaboration.ts +37 -5
- package/src/types/I_Item.ts +15 -0
- package/src/types/I_List.ts +15 -0
- package/src/types/I_Media.ts +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I_CampaignGoal } from
|
|
2
|
-
import { I_CampaignCollaborationMethod } from
|
|
3
|
-
import { I_Influencer } from
|
|
4
|
-
import { I_InfluencersList } from
|
|
5
|
-
import { I_CampaignDeadline } from
|
|
1
|
+
import { I_CampaignGoal } from './I_CampaignGoal';
|
|
2
|
+
import { I_CampaignCollaborationMethod } from './I_CampaignCollaborationMethod';
|
|
3
|
+
import { I_Influencer } from './I_Influencer';
|
|
4
|
+
import { I_InfluencersList } from './I_InfluencersLists';
|
|
5
|
+
import { I_CampaignDeadline } from './I_CampaignDeadline';
|
|
6
6
|
declare class I_Brief {
|
|
7
7
|
brand: string;
|
|
8
8
|
campaignTags: string;
|
|
@@ -21,8 +21,8 @@ export declare class I_Campaign {
|
|
|
21
21
|
name: string;
|
|
22
22
|
brief: I_Brief;
|
|
23
23
|
influencersList: {
|
|
24
|
-
id: I_InfluencersList[
|
|
25
|
-
name: I_InfluencersList[
|
|
24
|
+
id: I_InfluencersList['id'];
|
|
25
|
+
name: I_InfluencersList['name'];
|
|
26
26
|
influencers: I_Influencer[];
|
|
27
27
|
};
|
|
28
28
|
deadlines: I_CampaignDeadline[];
|
|
@@ -56,8 +56,8 @@ export declare class I_EditCampaignDTO {
|
|
|
56
56
|
viewsFrom: number;
|
|
57
57
|
viewsTo: number;
|
|
58
58
|
campaignTags: string;
|
|
59
|
-
campaignGoals:
|
|
60
|
-
campaignCollaborationMethods:
|
|
59
|
+
campaignGoals: string[];
|
|
60
|
+
campaignCollaborationMethods: string[];
|
|
61
61
|
minInfluencersQuantity: number;
|
|
62
62
|
maxInfluencersQuantity: number;
|
|
63
63
|
startDate: Date;
|
package/dist/types/I_Campaign.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { I_OfferStatus } from
|
|
1
|
+
import { I_OfferStatus } from './I_Offer';
|
|
2
2
|
export declare class I_CampaignDeadline {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
5
5
|
date: Date;
|
|
6
6
|
isConfirmed: boolean;
|
|
7
7
|
isReadyToConfirm: boolean;
|
|
8
|
+
createdAt: Date;
|
|
8
9
|
constructor(data?: Partial<I_CampaignDeadline>);
|
|
9
10
|
}
|
|
10
11
|
export declare class I_CreateCampaignDeadlineDTO {
|
|
@@ -19,6 +19,7 @@ class I_CampaignDeadline {
|
|
|
19
19
|
this.date = data?.date ?? null;
|
|
20
20
|
this.isConfirmed = data?.isConfirmed ?? null;
|
|
21
21
|
this.isReadyToConfirm = data?.isReadyToConfirm ?? null;
|
|
22
|
+
this.createdAt = data?.createdAt ?? null;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
exports.I_CampaignDeadline = I_CampaignDeadline;
|
|
@@ -66,7 +67,7 @@ class I_EditCampaignDeadlinesDTO {
|
|
|
66
67
|
constructor(data) {
|
|
67
68
|
this.campaignId = data?.campaignId ?? null;
|
|
68
69
|
Object.entries(data || {}).forEach(([key, value]) => {
|
|
69
|
-
if (key !==
|
|
70
|
+
if (key !== 'startDate' && key !== 'endDate') {
|
|
70
71
|
this[key] = value;
|
|
71
72
|
}
|
|
72
73
|
});
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import { I_Media } from './I_Media';
|
|
1
2
|
import { I_Offer } from './I_Offer';
|
|
3
|
+
import { I_User } from './I_User';
|
|
2
4
|
export declare class I_Collaboration {
|
|
3
5
|
id: string;
|
|
4
6
|
offer: I_Offer;
|
|
5
|
-
media: [];
|
|
7
|
+
media: I_Media[];
|
|
8
|
+
comments: I_CollaborationComment[];
|
|
6
9
|
}
|
|
7
|
-
export declare class
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
export declare class I_CollaborationComment {
|
|
11
|
+
id: string;
|
|
12
|
+
content: string;
|
|
13
|
+
collaboration: I_Collaboration;
|
|
14
|
+
author: I_User;
|
|
15
|
+
createdAt: Date;
|
|
10
16
|
}
|
|
11
17
|
export declare class I_GetCollaborationDTO {
|
|
12
18
|
collaborationId: string;
|
|
@@ -16,6 +22,10 @@ export declare class I_GetCollaborationByOfferDTO {
|
|
|
16
22
|
offerId: string;
|
|
17
23
|
constructor(data?: Partial<I_GetCollaborationByOfferDTO>);
|
|
18
24
|
}
|
|
25
|
+
export declare class I_GetCampaignCollaborationsDTO {
|
|
26
|
+
campaignId: string;
|
|
27
|
+
constructor(data?: Partial<I_GetCampaignCollaborationsDTO>);
|
|
28
|
+
}
|
|
19
29
|
export declare class I_GetCollaborationsDTO {
|
|
20
30
|
userId: string;
|
|
21
31
|
constructor(data?: Partial<I_GetCollaborationsDTO>);
|
|
@@ -28,8 +38,25 @@ export declare class I_CreateCollaborationDTO {
|
|
|
28
38
|
offerId: string;
|
|
29
39
|
constructor(data?: Partial<I_CreateCollaborationDTO>);
|
|
30
40
|
}
|
|
31
|
-
export declare class
|
|
41
|
+
export declare class I_UploadCollaborationMediaDTO {
|
|
32
42
|
collaborationId: string;
|
|
33
43
|
file: string;
|
|
34
44
|
fileName: string;
|
|
35
45
|
}
|
|
46
|
+
export declare class I_AddCollaborationCommentDTO {
|
|
47
|
+
collaborationId: string;
|
|
48
|
+
comment: string;
|
|
49
|
+
}
|
|
50
|
+
export declare class I_RequestCollaborationMediaAdjustmentDTO {
|
|
51
|
+
collaborationId: string;
|
|
52
|
+
comment: string;
|
|
53
|
+
}
|
|
54
|
+
export declare class I_AcceptCollaborationMediaDTO {
|
|
55
|
+
collaborationId: string;
|
|
56
|
+
}
|
|
57
|
+
export declare class I_RejectCollaborationMediaDTO {
|
|
58
|
+
collaborationId: string;
|
|
59
|
+
}
|
|
60
|
+
export declare class I_GetCollaborationCommentsDTO {
|
|
61
|
+
collaborationId: string;
|
|
62
|
+
}
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.I_GetCollaborationCommentsDTO = exports.I_RejectCollaborationMediaDTO = exports.I_AcceptCollaborationMediaDTO = exports.I_RequestCollaborationMediaAdjustmentDTO = exports.I_AddCollaborationCommentDTO = exports.I_UploadCollaborationMediaDTO = exports.I_CreateCollaborationDTO = exports.I_CollaborationComment = exports.I_Collaboration = void 0;
|
|
4
4
|
class I_Collaboration {
|
|
5
5
|
}
|
|
6
6
|
exports.I_Collaboration = I_Collaboration;
|
|
7
|
+
class I_CollaborationComment {
|
|
8
|
+
}
|
|
9
|
+
exports.I_CollaborationComment = I_CollaborationComment;
|
|
7
10
|
class I_CreateCollaborationDTO {
|
|
8
11
|
constructor(data) {
|
|
9
12
|
this.offerId = data?.offerId ?? null;
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
exports.I_CreateCollaborationDTO = I_CreateCollaborationDTO;
|
|
13
|
-
class
|
|
16
|
+
class I_UploadCollaborationMediaDTO {
|
|
17
|
+
}
|
|
18
|
+
exports.I_UploadCollaborationMediaDTO = I_UploadCollaborationMediaDTO;
|
|
19
|
+
class I_AddCollaborationCommentDTO {
|
|
20
|
+
}
|
|
21
|
+
exports.I_AddCollaborationCommentDTO = I_AddCollaborationCommentDTO;
|
|
22
|
+
class I_RequestCollaborationMediaAdjustmentDTO {
|
|
23
|
+
}
|
|
24
|
+
exports.I_RequestCollaborationMediaAdjustmentDTO = I_RequestCollaborationMediaAdjustmentDTO;
|
|
25
|
+
class I_AcceptCollaborationMediaDTO {
|
|
26
|
+
}
|
|
27
|
+
exports.I_AcceptCollaborationMediaDTO = I_AcceptCollaborationMediaDTO;
|
|
28
|
+
class I_RejectCollaborationMediaDTO {
|
|
29
|
+
}
|
|
30
|
+
exports.I_RejectCollaborationMediaDTO = I_RejectCollaborationMediaDTO;
|
|
31
|
+
class I_GetCollaborationCommentsDTO {
|
|
14
32
|
}
|
|
15
|
-
exports.
|
|
33
|
+
exports.I_GetCollaborationCommentsDTO = I_GetCollaborationCommentsDTO;
|
package/dist/types/I_Item.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare class I_Item<T> implements I_ResponseMessage {
|
|
|
5
5
|
status: T_FetchStatus;
|
|
6
6
|
message?: string;
|
|
7
7
|
constructor(data?: Partial<I_Item<T>>);
|
|
8
|
+
succeed?(data: T, message?: string): this;
|
|
9
|
+
fail?(message: string): this;
|
|
8
10
|
}
|
|
9
11
|
export declare const itemIsLoading: (item: I_Item<any>) => boolean;
|
|
10
12
|
export declare const itemIsResolving: (item: I_Item<any>) => boolean;
|
package/dist/types/I_Item.js
CHANGED
|
@@ -7,6 +7,17 @@ class I_Item {
|
|
|
7
7
|
this.status = data?.status || 'succeeded';
|
|
8
8
|
this.message = data?.message || '';
|
|
9
9
|
}
|
|
10
|
+
succeed(data, message) {
|
|
11
|
+
this.status = 'succeeded';
|
|
12
|
+
this.data = data;
|
|
13
|
+
this.message = message;
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
fail(message) {
|
|
17
|
+
this.status = 'failed';
|
|
18
|
+
this.message = message;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
10
21
|
}
|
|
11
22
|
exports.I_Item = I_Item;
|
|
12
23
|
const itemIsLoading = (item) => item.status === 'loading';
|
package/dist/types/I_List.d.ts
CHANGED
package/dist/types/I_List.js
CHANGED
|
@@ -7,5 +7,16 @@ class I_List {
|
|
|
7
7
|
this.status = data?.status || 'succeeded';
|
|
8
8
|
this.message = data?.message || '';
|
|
9
9
|
}
|
|
10
|
+
succeed(items, message) {
|
|
11
|
+
this.status = 'succeeded';
|
|
12
|
+
this.items = items;
|
|
13
|
+
this.message = message;
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
fail(message) {
|
|
17
|
+
this.status = 'failed';
|
|
18
|
+
this.message = message;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
10
21
|
}
|
|
11
22
|
exports.I_List = I_List;
|
package/dist/types/I_Media.d.ts
CHANGED
package/package.json
CHANGED
package/src/types/I_Campaign.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IsArray, IsNotEmpty, IsNumber, IsString } from
|
|
2
|
-
import { I_CampaignGoal } from
|
|
3
|
-
import { I_CampaignCollaborationMethod } from
|
|
4
|
-
import { I_Influencer } from
|
|
5
|
-
import { I_InfluencersList } from
|
|
6
|
-
import { I_CampaignDeadline } from
|
|
1
|
+
import { IsArray, IsNotEmpty, IsNumber, IsString } from 'class-validator';
|
|
2
|
+
import { I_CampaignGoal } from './I_CampaignGoal';
|
|
3
|
+
import { I_CampaignCollaborationMethod } from './I_CampaignCollaborationMethod';
|
|
4
|
+
import { I_Influencer } from './I_Influencer';
|
|
5
|
+
import { I_InfluencersList } from './I_InfluencersLists';
|
|
6
|
+
import { I_CampaignDeadline } from './I_CampaignDeadline';
|
|
7
7
|
|
|
8
8
|
class I_Brief {
|
|
9
9
|
brand: string;
|
|
@@ -37,8 +37,8 @@ export class I_Campaign {
|
|
|
37
37
|
name: string;
|
|
38
38
|
brief: I_Brief;
|
|
39
39
|
influencersList: {
|
|
40
|
-
id: I_InfluencersList[
|
|
41
|
-
name: I_InfluencersList[
|
|
40
|
+
id: I_InfluencersList['id'];
|
|
41
|
+
name: I_InfluencersList['name'];
|
|
42
42
|
influencers: I_Influencer[];
|
|
43
43
|
};
|
|
44
44
|
deadlines: I_CampaignDeadline[];
|
|
@@ -76,7 +76,7 @@ export class I_GetCampaignDTO {
|
|
|
76
76
|
id: string;
|
|
77
77
|
|
|
78
78
|
constructor(data: Partial<I_GetCampaignDTO>) {
|
|
79
|
-
this.id = data?.id ??
|
|
79
|
+
this.id = data?.id ?? '';
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -117,10 +117,10 @@ export class I_EditCampaignDTO {
|
|
|
117
117
|
campaignTags: string;
|
|
118
118
|
|
|
119
119
|
@IsArray()
|
|
120
|
-
campaignGoals:
|
|
120
|
+
campaignGoals: string[];
|
|
121
121
|
|
|
122
122
|
@IsArray()
|
|
123
|
-
campaignCollaborationMethods:
|
|
123
|
+
campaignCollaborationMethods: string[];
|
|
124
124
|
|
|
125
125
|
@IsNotEmpty()
|
|
126
126
|
@IsNumber()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IsNotEmpty, IsOptional, IsString } from
|
|
2
|
-
import { I_OfferStatus } from
|
|
1
|
+
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
|
2
|
+
import { I_OfferStatus } from './I_Offer';
|
|
3
3
|
|
|
4
4
|
export class I_CampaignDeadline {
|
|
5
5
|
id: string;
|
|
@@ -7,6 +7,7 @@ export class I_CampaignDeadline {
|
|
|
7
7
|
date: Date;
|
|
8
8
|
isConfirmed: boolean;
|
|
9
9
|
isReadyToConfirm: boolean;
|
|
10
|
+
createdAt: Date;
|
|
10
11
|
|
|
11
12
|
constructor(data?: Partial<I_CampaignDeadline>) {
|
|
12
13
|
this.id = data?.id ?? null;
|
|
@@ -14,6 +15,7 @@ export class I_CampaignDeadline {
|
|
|
14
15
|
this.date = data?.date ?? null;
|
|
15
16
|
this.isConfirmed = data?.isConfirmed ?? null;
|
|
16
17
|
this.isReadyToConfirm = data?.isReadyToConfirm ?? null;
|
|
18
|
+
this.createdAt = data?.createdAt ?? null;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -57,7 +59,7 @@ export class I_EditCampaignDeadlinesDTO {
|
|
|
57
59
|
this.campaignId = data?.campaignId ?? null;
|
|
58
60
|
|
|
59
61
|
Object.entries(data || {}).forEach(([key, value]) => {
|
|
60
|
-
if (key !==
|
|
62
|
+
if (key !== 'startDate' && key !== 'endDate') {
|
|
61
63
|
this[key] = value;
|
|
62
64
|
}
|
|
63
65
|
});
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { I_Media } from './I_Media';
|
|
2
2
|
import { I_Offer } from './I_Offer';
|
|
3
|
+
import { I_User } from './I_User';
|
|
3
4
|
|
|
4
5
|
export class I_Collaboration {
|
|
5
6
|
id: string;
|
|
6
7
|
offer: I_Offer;
|
|
7
|
-
media: [];
|
|
8
|
+
media: I_Media[];
|
|
9
|
+
comments: I_CollaborationComment[];
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
export class I_CollaborationComment {
|
|
13
|
+
id: string;
|
|
14
|
+
content: string;
|
|
15
|
+
collaboration: I_Collaboration;
|
|
16
|
+
author: I_User;
|
|
17
|
+
createdAt: Date;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
export declare class I_GetCollaborationDTO {
|
|
@@ -22,6 +27,11 @@ export declare class I_GetCollaborationByOfferDTO {
|
|
|
22
27
|
constructor(data?: Partial<I_GetCollaborationByOfferDTO>);
|
|
23
28
|
}
|
|
24
29
|
|
|
30
|
+
export declare class I_GetCampaignCollaborationsDTO {
|
|
31
|
+
campaignId: string;
|
|
32
|
+
constructor(data?: Partial<I_GetCampaignCollaborationsDTO>);
|
|
33
|
+
}
|
|
34
|
+
|
|
25
35
|
export declare class I_GetCollaborationsDTO {
|
|
26
36
|
userId: string;
|
|
27
37
|
constructor(data?: Partial<I_GetCollaborationsDTO>);
|
|
@@ -40,8 +50,30 @@ export class I_CreateCollaborationDTO {
|
|
|
40
50
|
}
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
export class
|
|
53
|
+
export class I_UploadCollaborationMediaDTO {
|
|
44
54
|
collaborationId: string;
|
|
45
55
|
file: string;
|
|
46
56
|
fileName: string;
|
|
47
57
|
}
|
|
58
|
+
|
|
59
|
+
export class I_AddCollaborationCommentDTO {
|
|
60
|
+
collaborationId: string;
|
|
61
|
+
comment: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export class I_RequestCollaborationMediaAdjustmentDTO {
|
|
65
|
+
collaborationId: string;
|
|
66
|
+
comment: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class I_AcceptCollaborationMediaDTO {
|
|
70
|
+
collaborationId: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export class I_RejectCollaborationMediaDTO {
|
|
74
|
+
collaborationId: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export class I_GetCollaborationCommentsDTO {
|
|
78
|
+
collaborationId: string;
|
|
79
|
+
}
|
package/src/types/I_Item.ts
CHANGED
|
@@ -11,6 +11,21 @@ export class I_Item<T> implements I_ResponseMessage {
|
|
|
11
11
|
this.status = data?.status || 'succeeded';
|
|
12
12
|
this.message = data?.message || '';
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
succeed?(data: T, message?: string): this {
|
|
16
|
+
this.status = 'succeeded';
|
|
17
|
+
this.data = data;
|
|
18
|
+
this.message = message;
|
|
19
|
+
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fail?(message: string): this {
|
|
24
|
+
this.status = 'failed';
|
|
25
|
+
this.message = message;
|
|
26
|
+
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
14
29
|
}
|
|
15
30
|
|
|
16
31
|
export const itemIsLoading = (item: I_Item<any>) => item.status === 'loading';
|
package/src/types/I_List.ts
CHANGED
|
@@ -11,4 +11,19 @@ export class I_List<T> implements I_ResponseMessage {
|
|
|
11
11
|
this.status = data?.status || 'succeeded';
|
|
12
12
|
this.message = data?.message || '';
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
succeed?(items: T[], message?: string): this {
|
|
16
|
+
this.status = 'succeeded';
|
|
17
|
+
this.items = items;
|
|
18
|
+
this.message = message;
|
|
19
|
+
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fail?(message: string): this {
|
|
24
|
+
this.status = 'failed';
|
|
25
|
+
this.message = message;
|
|
26
|
+
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
14
29
|
}
|