@silexpert/core 1.3.154 → 1.3.155
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/cjs/api/resources.d.ts +0 -2
- package/dist/cjs/api/resources.d.ts.map +1 -1
- package/dist/cjs/api/resources.js +0 -2
- package/dist/cjs/api/resources.js.map +1 -1
- package/dist/cjs/types/Enum/InternalService.d.ts +4 -0
- package/dist/cjs/types/Enum/InternalService.d.ts.map +1 -1
- package/dist/cjs/types/Enum/InternalService.js +4 -0
- package/dist/cjs/types/Enum/InternalService.js.map +1 -1
- package/dist/cjs/types/Enum/ReasonTerminationType.d.ts +2 -1
- package/dist/cjs/types/Enum/ReasonTerminationType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/ReasonTerminationType.js +6 -0
- package/dist/cjs/types/Enum/ReasonTerminationType.js.map +1 -1
- package/dist/cjs/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/TaskResponseType.js +17 -6
- package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
- package/dist/cjs/types/Interface/models/ISociety.d.ts +1 -0
- package/dist/cjs/types/Interface/models/ISociety.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/ISociety.js.map +1 -1
- package/dist/cjs/types/index.d.ts +0 -6
- package/dist/cjs/types/index.d.ts.map +1 -1
- package/dist/cjs/types/index.js +0 -6
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/vat/3517/century25.d.ts.map +1 -1
- package/dist/cjs/utils/vat/3517/century25.js +8 -14
- package/dist/cjs/utils/vat/3517/century25.js.map +1 -1
- package/dist/mjs/api/resources.d.ts +0 -2
- package/dist/mjs/api/resources.d.ts.map +1 -1
- package/dist/mjs/api/resources.js +0 -2
- package/dist/mjs/api/resources.js.map +1 -1
- package/dist/mjs/types/Enum/InternalService.d.ts +4 -0
- package/dist/mjs/types/Enum/InternalService.d.ts.map +1 -1
- package/dist/mjs/types/Enum/InternalService.js +4 -0
- package/dist/mjs/types/Enum/InternalService.js.map +1 -1
- package/dist/mjs/types/Enum/ReasonTerminationType.d.ts +2 -1
- package/dist/mjs/types/Enum/ReasonTerminationType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/ReasonTerminationType.js +6 -0
- package/dist/mjs/types/Enum/ReasonTerminationType.js.map +1 -1
- package/dist/mjs/types/Enum/TaskResponseType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/TaskResponseType.js +17 -6
- package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
- package/dist/mjs/types/Interface/models/ISociety.d.ts +1 -0
- package/dist/mjs/types/Interface/models/ISociety.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/ISociety.js.map +1 -1
- package/dist/mjs/types/index.d.ts +0 -6
- package/dist/mjs/types/index.d.ts.map +1 -1
- package/dist/mjs/types/index.js +0 -6
- package/dist/mjs/types/index.js.map +1 -1
- package/dist/mjs/utils/vat/3517/century25.d.ts.map +1 -1
- package/dist/mjs/utils/vat/3517/century25.js +3 -9
- package/dist/mjs/utils/vat/3517/century25.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources.ts +0 -2
- package/ts/types/Enum/InternalService.ts +4 -0
- package/ts/types/Enum/ReasonTerminationType.ts +6 -0
- package/ts/types/Enum/TaskResponseType.ts +17 -6
- package/ts/types/Interface/models/ISociety.ts +1 -0
- package/ts/types/index.ts +0 -6
- package/ts/utils/vat/3517/century25.ts +3 -9
- package/dist/cjs/api/resources/Contest.d.ts +0 -12
- package/dist/cjs/api/resources/Contest.d.ts.map +0 -1
- package/dist/cjs/api/resources/Contest.js +0 -43
- package/dist/cjs/api/resources/Contest.js.map +0 -1
- package/dist/cjs/types/Enum/Contest.d.ts +0 -6
- package/dist/cjs/types/Enum/Contest.d.ts.map +0 -1
- package/dist/cjs/types/Enum/Contest.js +0 -10
- package/dist/cjs/types/Enum/Contest.js.map +0 -1
- package/dist/cjs/types/Interface/api/contest/Create.d.ts +0 -47
- package/dist/cjs/types/Interface/api/contest/Create.d.ts.map +0 -1
- package/dist/cjs/types/Interface/api/contest/Create.js +0 -201
- package/dist/cjs/types/Interface/api/contest/Create.js.map +0 -1
- package/dist/cjs/types/Interface/api/contest/Query.d.ts +0 -9
- package/dist/cjs/types/Interface/api/contest/Query.d.ts.map +0 -1
- package/dist/cjs/types/Interface/api/contest/Query.js +0 -46
- package/dist/cjs/types/Interface/api/contest/Query.js.map +0 -1
- package/dist/cjs/types/Interface/api/contest/Read.d.ts +0 -6
- package/dist/cjs/types/Interface/api/contest/Read.d.ts.map +0 -1
- package/dist/cjs/types/Interface/api/contest/Read.js +0 -3
- package/dist/cjs/types/Interface/api/contest/Read.js.map +0 -1
- package/dist/cjs/types/Interface/models/IContest.d.ts +0 -18
- package/dist/cjs/types/Interface/models/IContest.d.ts.map +0 -1
- package/dist/cjs/types/Interface/models/IContest.js +0 -3
- package/dist/cjs/types/Interface/models/IContest.js.map +0 -1
- package/dist/cjs/types/Interface/models/IUserContest.d.ts +0 -24
- package/dist/cjs/types/Interface/models/IUserContest.d.ts.map +0 -1
- package/dist/cjs/types/Interface/models/IUserContest.js +0 -3
- package/dist/cjs/types/Interface/models/IUserContest.js.map +0 -1
- package/dist/mjs/api/resources/Contest.d.ts +0 -12
- package/dist/mjs/api/resources/Contest.d.ts.map +0 -1
- package/dist/mjs/api/resources/Contest.js +0 -39
- package/dist/mjs/api/resources/Contest.js.map +0 -1
- package/dist/mjs/types/Enum/Contest.d.ts +0 -6
- package/dist/mjs/types/Enum/Contest.d.ts.map +0 -1
- package/dist/mjs/types/Enum/Contest.js +0 -7
- package/dist/mjs/types/Enum/Contest.js.map +0 -1
- package/dist/mjs/types/Interface/api/contest/Create.d.ts +0 -47
- package/dist/mjs/types/Interface/api/contest/Create.d.ts.map +0 -1
- package/dist/mjs/types/Interface/api/contest/Create.js +0 -228
- package/dist/mjs/types/Interface/api/contest/Create.js.map +0 -1
- package/dist/mjs/types/Interface/api/contest/Query.d.ts +0 -9
- package/dist/mjs/types/Interface/api/contest/Query.d.ts.map +0 -1
- package/dist/mjs/types/Interface/api/contest/Query.js +0 -48
- package/dist/mjs/types/Interface/api/contest/Query.js.map +0 -1
- package/dist/mjs/types/Interface/api/contest/Read.d.ts +0 -6
- package/dist/mjs/types/Interface/api/contest/Read.d.ts.map +0 -1
- package/dist/mjs/types/Interface/api/contest/Read.js +0 -2
- package/dist/mjs/types/Interface/api/contest/Read.js.map +0 -1
- package/dist/mjs/types/Interface/models/IContest.d.ts +0 -18
- package/dist/mjs/types/Interface/models/IContest.d.ts.map +0 -1
- package/dist/mjs/types/Interface/models/IContest.js +0 -2
- package/dist/mjs/types/Interface/models/IContest.js.map +0 -1
- package/dist/mjs/types/Interface/models/IUserContest.d.ts +0 -24
- package/dist/mjs/types/Interface/models/IUserContest.d.ts.map +0 -1
- package/dist/mjs/types/Interface/models/IUserContest.js +0 -2
- package/dist/mjs/types/Interface/models/IUserContest.js.map +0 -1
- package/ts/api/resources/Contest.ts +0 -45
- package/ts/types/Enum/Contest.ts +0 -5
- package/ts/types/Interface/api/contest/Create.ts +0 -149
- package/ts/types/Interface/api/contest/Query.ts +0 -26
- package/ts/types/Interface/api/contest/Read.ts +0 -6
- package/ts/types/Interface/models/IContest.ts +0 -20
- package/ts/types/Interface/models/IUserContest.ts +0 -26
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { isDefined } from 'class-validator';
|
|
2
|
-
import { IUserContest, IContest, QueryFetchUserContest, CreateUserContest, CreateVoteContest } from '../../types';
|
|
3
|
-
import { Resource } from '../Resource';
|
|
4
|
-
|
|
5
|
-
export class Contest extends Resource {
|
|
6
|
-
fetchUsers(params: QueryFetchUserContest): Promise<IUserContest[]> {
|
|
7
|
-
return this.axios.$get('contest/users', { params });
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
fetchUsersCount(): Promise<number> {
|
|
11
|
-
return this.axios.$get('contest/users/count');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
fetchVotesCount(): Promise<number> {
|
|
15
|
-
return this.axios.$get('contest/votes/count');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
fethTopThree(): Promise<IUserContest[]> {
|
|
19
|
-
return this.axios.$get('contest/users/top');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
createUser(payload: CreateUserContest): Promise<IUserContest> {
|
|
23
|
-
const formData = new FormData();
|
|
24
|
-
Object.entries(payload).forEach(([key, value]) => {
|
|
25
|
-
if (isDefined(value) || key === 'writeDpae') {
|
|
26
|
-
if (['logo', 'photo'].includes(key)) {
|
|
27
|
-
formData.append(key, value as File);
|
|
28
|
-
} else {
|
|
29
|
-
formData.append(key, `${value}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return this.axios.$post('contest/user', formData, {
|
|
34
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
checkIdentity(payload: CreateVoteContest): Promise<boolean> {
|
|
39
|
-
return this.axios.$post('contest/vote/check', payload);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
createVote(payload: CreateVoteContest): Promise<IContest> {
|
|
43
|
-
return this.axios.$post('contest/vote', payload);
|
|
44
|
-
}
|
|
45
|
-
}
|
package/ts/types/Enum/Contest.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { IsOptional, IsBoolean, IsNumber, IsString, IsIn } from 'class-validator';
|
|
2
|
-
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
3
|
-
import { TFile } from '../file/TFile';
|
|
4
|
-
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
5
|
-
import { ContestType } from '../../../Enum/Contest';
|
|
6
|
-
|
|
7
|
-
export class CreateUserContest {
|
|
8
|
-
@ApiProperty()
|
|
9
|
-
firstname: string;
|
|
10
|
-
|
|
11
|
-
@ApiProperty()
|
|
12
|
-
lastname: string;
|
|
13
|
-
|
|
14
|
-
@ApiProperty()
|
|
15
|
-
email: string;
|
|
16
|
-
|
|
17
|
-
@ApiProperty()
|
|
18
|
-
phone: string;
|
|
19
|
-
|
|
20
|
-
@ApiProperty()
|
|
21
|
-
societyName: string;
|
|
22
|
-
|
|
23
|
-
@ApiProperty()
|
|
24
|
-
siren: string;
|
|
25
|
-
|
|
26
|
-
@ApiPropertyOptional()
|
|
27
|
-
companyWebsite?: string;
|
|
28
|
-
|
|
29
|
-
@ApiPropertyOptional()
|
|
30
|
-
productDescription?: string;
|
|
31
|
-
|
|
32
|
-
@ApiPropertyOptional()
|
|
33
|
-
societyDescription?: string;
|
|
34
|
-
|
|
35
|
-
@ApiProperty()
|
|
36
|
-
photo: TFile;
|
|
37
|
-
|
|
38
|
-
@ApiPropertyOptional()
|
|
39
|
-
@IsOptional()
|
|
40
|
-
logo?: TFile;
|
|
41
|
-
|
|
42
|
-
@ApiPropertyOptional()
|
|
43
|
-
@IsOptional()
|
|
44
|
-
banner?: TFile;
|
|
45
|
-
|
|
46
|
-
@ApiProperty()
|
|
47
|
-
@IsBoolean()
|
|
48
|
-
@ToBoolean()
|
|
49
|
-
acceptNewsletter: boolean;
|
|
50
|
-
|
|
51
|
-
@ApiProperty()
|
|
52
|
-
@IsBoolean()
|
|
53
|
-
@ToBoolean()
|
|
54
|
-
acceptPromotion: boolean;
|
|
55
|
-
|
|
56
|
-
@ApiPropertyOptional()
|
|
57
|
-
@IsOptional()
|
|
58
|
-
@IsBoolean()
|
|
59
|
-
@ToBoolean()
|
|
60
|
-
isTestMode?: boolean;
|
|
61
|
-
|
|
62
|
-
@ApiPropertyOptional()
|
|
63
|
-
recaptcha?: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export class CreateCheckVote {
|
|
67
|
-
@ApiProperty()
|
|
68
|
-
email: string;
|
|
69
|
-
|
|
70
|
-
@ApiProperty()
|
|
71
|
-
ipAddress: string;
|
|
72
|
-
|
|
73
|
-
@ApiProperty()
|
|
74
|
-
idVoter: number;
|
|
75
|
-
|
|
76
|
-
@ApiProperty()
|
|
77
|
-
@IsBoolean()
|
|
78
|
-
@ToBoolean()
|
|
79
|
-
acceptContact: boolean;
|
|
80
|
-
|
|
81
|
-
@ApiPropertyOptional()
|
|
82
|
-
recaptcha?: string;
|
|
83
|
-
|
|
84
|
-
@ApiPropertyOptional()
|
|
85
|
-
@IsOptional()
|
|
86
|
-
@IsBoolean()
|
|
87
|
-
@ToBoolean()
|
|
88
|
-
isTestMode?: boolean;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export class CreateVoteContest {
|
|
92
|
-
@ApiProperty()
|
|
93
|
-
hashMail: string;
|
|
94
|
-
|
|
95
|
-
@ApiProperty()
|
|
96
|
-
userHash: string;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export class CreateGeneriqueContestResult {
|
|
100
|
-
@ApiProperty()
|
|
101
|
-
email: string;
|
|
102
|
-
|
|
103
|
-
@ApiProperty()
|
|
104
|
-
ipAddress: string;
|
|
105
|
-
|
|
106
|
-
@ApiProperty()
|
|
107
|
-
@IsBoolean()
|
|
108
|
-
@ToBoolean()
|
|
109
|
-
acceptContact: boolean;
|
|
110
|
-
|
|
111
|
-
@ApiProperty()
|
|
112
|
-
@IsNumber()
|
|
113
|
-
@IsIn([ContestType.ENTREPRENEUR, ContestType.BIKE_1, ContestType.BIKE_2])
|
|
114
|
-
idTypeContest: number;
|
|
115
|
-
|
|
116
|
-
@ApiProperty()
|
|
117
|
-
@IsString()
|
|
118
|
-
result: string;
|
|
119
|
-
|
|
120
|
-
@ApiPropertyOptional()
|
|
121
|
-
recaptcha?: string;
|
|
122
|
-
|
|
123
|
-
@ApiPropertyOptional()
|
|
124
|
-
@IsOptional()
|
|
125
|
-
@IsBoolean()
|
|
126
|
-
@ToBoolean()
|
|
127
|
-
isTestMode?: boolean;
|
|
128
|
-
|
|
129
|
-
@ApiPropertyOptional()
|
|
130
|
-
@IsOptional()
|
|
131
|
-
@IsString()
|
|
132
|
-
secret?: string;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export class CreateEmail {
|
|
136
|
-
@ApiProperty()
|
|
137
|
-
@IsNumber()
|
|
138
|
-
winnerId: number;
|
|
139
|
-
|
|
140
|
-
@ApiProperty()
|
|
141
|
-
@IsNumber()
|
|
142
|
-
@IsIn([ContestType.ENTREPRENEUR, ContestType.BIKE_1, ContestType.BIKE_2])
|
|
143
|
-
idTypeContest: number;
|
|
144
|
-
|
|
145
|
-
@ApiPropertyOptional()
|
|
146
|
-
@IsOptional()
|
|
147
|
-
@IsString()
|
|
148
|
-
secret?: string;
|
|
149
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IsBoolean, IsOptional } from 'class-validator';
|
|
2
|
-
import { ApiPropertyOptional } from '../../../../utils';
|
|
3
|
-
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
4
|
-
|
|
5
|
-
export class QueryFetchUserContest {
|
|
6
|
-
@ApiPropertyOptional()
|
|
7
|
-
search?: string;
|
|
8
|
-
|
|
9
|
-
@ApiPropertyOptional()
|
|
10
|
-
page?: number;
|
|
11
|
-
|
|
12
|
-
@ApiPropertyOptional()
|
|
13
|
-
limit?: number;
|
|
14
|
-
|
|
15
|
-
@ApiPropertyOptional()
|
|
16
|
-
orderBy?: string;
|
|
17
|
-
|
|
18
|
-
@ApiPropertyOptional()
|
|
19
|
-
@IsBoolean()
|
|
20
|
-
@ToBoolean()
|
|
21
|
-
@IsOptional()
|
|
22
|
-
top?: boolean | null;
|
|
23
|
-
|
|
24
|
-
@ApiPropertyOptional()
|
|
25
|
-
idToPutFirst?: number;
|
|
26
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IUser } from '../..';
|
|
2
|
-
|
|
3
|
-
export interface IContest {
|
|
4
|
-
id?: number;
|
|
5
|
-
emailVoter: string;
|
|
6
|
-
hashMail: string;
|
|
7
|
-
ipAddress: string;
|
|
8
|
-
hasVoteBeenCompleted: boolean;
|
|
9
|
-
acceptContact: boolean;
|
|
10
|
-
result: string; // object of result depending the contest
|
|
11
|
-
idTypeContest: number;
|
|
12
|
-
isSuspectedToBeScam: boolean;
|
|
13
|
-
idUserVoteFor?: number | null;
|
|
14
|
-
createdAt?: Date | null;
|
|
15
|
-
updatedAt?: Date | null;
|
|
16
|
-
deletedAt?: Date | null;
|
|
17
|
-
|
|
18
|
-
// Associations
|
|
19
|
-
userVoteFor?: IUser;
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IContest } from './IContest';
|
|
2
|
-
|
|
3
|
-
export interface IUserContest {
|
|
4
|
-
id?: number;
|
|
5
|
-
firstname: string;
|
|
6
|
-
lastname: string;
|
|
7
|
-
email: string;
|
|
8
|
-
hash: string;
|
|
9
|
-
phone: string;
|
|
10
|
-
societyName: string;
|
|
11
|
-
siren: string;
|
|
12
|
-
companyWebsite?: string | null;
|
|
13
|
-
productDescription?: string | null;
|
|
14
|
-
societyDescription?: string | null;
|
|
15
|
-
tokenPhoto?: string | null;
|
|
16
|
-
tokenLogo?: string | null;
|
|
17
|
-
tokenBanner?: string | null;
|
|
18
|
-
acceptNewsletter: boolean;
|
|
19
|
-
acceptPromotion: boolean;
|
|
20
|
-
createdAt?: Date | null;
|
|
21
|
-
updatedAt?: Date | null;
|
|
22
|
-
deletedAt?: Date | null;
|
|
23
|
-
|
|
24
|
-
// associations
|
|
25
|
-
contests: IContest[];
|
|
26
|
-
}
|