@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.
Files changed (121) hide show
  1. package/dist/cjs/api/resources.d.ts +0 -2
  2. package/dist/cjs/api/resources.d.ts.map +1 -1
  3. package/dist/cjs/api/resources.js +0 -2
  4. package/dist/cjs/api/resources.js.map +1 -1
  5. package/dist/cjs/types/Enum/InternalService.d.ts +4 -0
  6. package/dist/cjs/types/Enum/InternalService.d.ts.map +1 -1
  7. package/dist/cjs/types/Enum/InternalService.js +4 -0
  8. package/dist/cjs/types/Enum/InternalService.js.map +1 -1
  9. package/dist/cjs/types/Enum/ReasonTerminationType.d.ts +2 -1
  10. package/dist/cjs/types/Enum/ReasonTerminationType.d.ts.map +1 -1
  11. package/dist/cjs/types/Enum/ReasonTerminationType.js +6 -0
  12. package/dist/cjs/types/Enum/ReasonTerminationType.js.map +1 -1
  13. package/dist/cjs/types/Enum/TaskResponseType.d.ts.map +1 -1
  14. package/dist/cjs/types/Enum/TaskResponseType.js +17 -6
  15. package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
  16. package/dist/cjs/types/Interface/models/ISociety.d.ts +1 -0
  17. package/dist/cjs/types/Interface/models/ISociety.d.ts.map +1 -1
  18. package/dist/cjs/types/Interface/models/ISociety.js.map +1 -1
  19. package/dist/cjs/types/index.d.ts +0 -6
  20. package/dist/cjs/types/index.d.ts.map +1 -1
  21. package/dist/cjs/types/index.js +0 -6
  22. package/dist/cjs/types/index.js.map +1 -1
  23. package/dist/cjs/utils/vat/3517/century25.d.ts.map +1 -1
  24. package/dist/cjs/utils/vat/3517/century25.js +8 -14
  25. package/dist/cjs/utils/vat/3517/century25.js.map +1 -1
  26. package/dist/mjs/api/resources.d.ts +0 -2
  27. package/dist/mjs/api/resources.d.ts.map +1 -1
  28. package/dist/mjs/api/resources.js +0 -2
  29. package/dist/mjs/api/resources.js.map +1 -1
  30. package/dist/mjs/types/Enum/InternalService.d.ts +4 -0
  31. package/dist/mjs/types/Enum/InternalService.d.ts.map +1 -1
  32. package/dist/mjs/types/Enum/InternalService.js +4 -0
  33. package/dist/mjs/types/Enum/InternalService.js.map +1 -1
  34. package/dist/mjs/types/Enum/ReasonTerminationType.d.ts +2 -1
  35. package/dist/mjs/types/Enum/ReasonTerminationType.d.ts.map +1 -1
  36. package/dist/mjs/types/Enum/ReasonTerminationType.js +6 -0
  37. package/dist/mjs/types/Enum/ReasonTerminationType.js.map +1 -1
  38. package/dist/mjs/types/Enum/TaskResponseType.d.ts.map +1 -1
  39. package/dist/mjs/types/Enum/TaskResponseType.js +17 -6
  40. package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
  41. package/dist/mjs/types/Interface/models/ISociety.d.ts +1 -0
  42. package/dist/mjs/types/Interface/models/ISociety.d.ts.map +1 -1
  43. package/dist/mjs/types/Interface/models/ISociety.js.map +1 -1
  44. package/dist/mjs/types/index.d.ts +0 -6
  45. package/dist/mjs/types/index.d.ts.map +1 -1
  46. package/dist/mjs/types/index.js +0 -6
  47. package/dist/mjs/types/index.js.map +1 -1
  48. package/dist/mjs/utils/vat/3517/century25.d.ts.map +1 -1
  49. package/dist/mjs/utils/vat/3517/century25.js +3 -9
  50. package/dist/mjs/utils/vat/3517/century25.js.map +1 -1
  51. package/package.json +1 -1
  52. package/ts/api/resources.ts +0 -2
  53. package/ts/types/Enum/InternalService.ts +4 -0
  54. package/ts/types/Enum/ReasonTerminationType.ts +6 -0
  55. package/ts/types/Enum/TaskResponseType.ts +17 -6
  56. package/ts/types/Interface/models/ISociety.ts +1 -0
  57. package/ts/types/index.ts +0 -6
  58. package/ts/utils/vat/3517/century25.ts +3 -9
  59. package/dist/cjs/api/resources/Contest.d.ts +0 -12
  60. package/dist/cjs/api/resources/Contest.d.ts.map +0 -1
  61. package/dist/cjs/api/resources/Contest.js +0 -43
  62. package/dist/cjs/api/resources/Contest.js.map +0 -1
  63. package/dist/cjs/types/Enum/Contest.d.ts +0 -6
  64. package/dist/cjs/types/Enum/Contest.d.ts.map +0 -1
  65. package/dist/cjs/types/Enum/Contest.js +0 -10
  66. package/dist/cjs/types/Enum/Contest.js.map +0 -1
  67. package/dist/cjs/types/Interface/api/contest/Create.d.ts +0 -47
  68. package/dist/cjs/types/Interface/api/contest/Create.d.ts.map +0 -1
  69. package/dist/cjs/types/Interface/api/contest/Create.js +0 -201
  70. package/dist/cjs/types/Interface/api/contest/Create.js.map +0 -1
  71. package/dist/cjs/types/Interface/api/contest/Query.d.ts +0 -9
  72. package/dist/cjs/types/Interface/api/contest/Query.d.ts.map +0 -1
  73. package/dist/cjs/types/Interface/api/contest/Query.js +0 -46
  74. package/dist/cjs/types/Interface/api/contest/Query.js.map +0 -1
  75. package/dist/cjs/types/Interface/api/contest/Read.d.ts +0 -6
  76. package/dist/cjs/types/Interface/api/contest/Read.d.ts.map +0 -1
  77. package/dist/cjs/types/Interface/api/contest/Read.js +0 -3
  78. package/dist/cjs/types/Interface/api/contest/Read.js.map +0 -1
  79. package/dist/cjs/types/Interface/models/IContest.d.ts +0 -18
  80. package/dist/cjs/types/Interface/models/IContest.d.ts.map +0 -1
  81. package/dist/cjs/types/Interface/models/IContest.js +0 -3
  82. package/dist/cjs/types/Interface/models/IContest.js.map +0 -1
  83. package/dist/cjs/types/Interface/models/IUserContest.d.ts +0 -24
  84. package/dist/cjs/types/Interface/models/IUserContest.d.ts.map +0 -1
  85. package/dist/cjs/types/Interface/models/IUserContest.js +0 -3
  86. package/dist/cjs/types/Interface/models/IUserContest.js.map +0 -1
  87. package/dist/mjs/api/resources/Contest.d.ts +0 -12
  88. package/dist/mjs/api/resources/Contest.d.ts.map +0 -1
  89. package/dist/mjs/api/resources/Contest.js +0 -39
  90. package/dist/mjs/api/resources/Contest.js.map +0 -1
  91. package/dist/mjs/types/Enum/Contest.d.ts +0 -6
  92. package/dist/mjs/types/Enum/Contest.d.ts.map +0 -1
  93. package/dist/mjs/types/Enum/Contest.js +0 -7
  94. package/dist/mjs/types/Enum/Contest.js.map +0 -1
  95. package/dist/mjs/types/Interface/api/contest/Create.d.ts +0 -47
  96. package/dist/mjs/types/Interface/api/contest/Create.d.ts.map +0 -1
  97. package/dist/mjs/types/Interface/api/contest/Create.js +0 -228
  98. package/dist/mjs/types/Interface/api/contest/Create.js.map +0 -1
  99. package/dist/mjs/types/Interface/api/contest/Query.d.ts +0 -9
  100. package/dist/mjs/types/Interface/api/contest/Query.d.ts.map +0 -1
  101. package/dist/mjs/types/Interface/api/contest/Query.js +0 -48
  102. package/dist/mjs/types/Interface/api/contest/Query.js.map +0 -1
  103. package/dist/mjs/types/Interface/api/contest/Read.d.ts +0 -6
  104. package/dist/mjs/types/Interface/api/contest/Read.d.ts.map +0 -1
  105. package/dist/mjs/types/Interface/api/contest/Read.js +0 -2
  106. package/dist/mjs/types/Interface/api/contest/Read.js.map +0 -1
  107. package/dist/mjs/types/Interface/models/IContest.d.ts +0 -18
  108. package/dist/mjs/types/Interface/models/IContest.d.ts.map +0 -1
  109. package/dist/mjs/types/Interface/models/IContest.js +0 -2
  110. package/dist/mjs/types/Interface/models/IContest.js.map +0 -1
  111. package/dist/mjs/types/Interface/models/IUserContest.d.ts +0 -24
  112. package/dist/mjs/types/Interface/models/IUserContest.d.ts.map +0 -1
  113. package/dist/mjs/types/Interface/models/IUserContest.js +0 -2
  114. package/dist/mjs/types/Interface/models/IUserContest.js.map +0 -1
  115. package/ts/api/resources/Contest.ts +0 -45
  116. package/ts/types/Enum/Contest.ts +0 -5
  117. package/ts/types/Interface/api/contest/Create.ts +0 -149
  118. package/ts/types/Interface/api/contest/Query.ts +0 -26
  119. package/ts/types/Interface/api/contest/Read.ts +0 -6
  120. package/ts/types/Interface/models/IContest.ts +0 -20
  121. 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
- }
@@ -1,5 +0,0 @@
1
- export enum ContestType {
2
- ENTREPRENEUR = 1,
3
- BIKE_1 = 2,
4
- BIKE_2 = 3,
5
- }
@@ -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,6 +0,0 @@
1
- import { IUserContest } from '../../models/IUserContest';
2
-
3
- export type ReadVoteChecking = {
4
- success: boolean;
5
- existingVoteUser: IUserContest | null;
6
- };
@@ -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
- }