@silexpert/core 2.0.63-0 → 2.0.63

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 (41) hide show
  1. package/dist/api/resources/HumanResourceLibrary.d.ts +5 -0
  2. package/dist/api/resources/HumanResourceLibrary.d.ts.map +1 -1
  3. package/dist/api/resources/HumanResourceLibrary.js +12 -0
  4. package/dist/api/resources/HumanResourceLibrary.js.map +1 -1
  5. package/dist/api/resources/Library.d.ts +0 -1
  6. package/dist/api/resources/Library.d.ts.map +1 -1
  7. package/dist/api/resources/Library.js +0 -8
  8. package/dist/api/resources/Library.js.map +1 -1
  9. package/dist/api/resources/zendesk/Ticket.d.ts +12 -0
  10. package/dist/api/resources/zendesk/Ticket.d.ts.map +1 -0
  11. package/dist/api/resources/zendesk/Ticket.js +40 -0
  12. package/dist/api/resources/zendesk/Ticket.js.map +1 -0
  13. package/dist/api/resources.d.ts +2 -0
  14. package/dist/api/resources.d.ts.map +1 -1
  15. package/dist/api/resources.js +2 -0
  16. package/dist/api/resources.js.map +1 -1
  17. package/dist/types/Enum/Zendesk.d.ts +40 -0
  18. package/dist/types/Enum/Zendesk.d.ts.map +1 -0
  19. package/dist/types/Enum/Zendesk.js +40 -0
  20. package/dist/types/Enum/Zendesk.js.map +1 -0
  21. package/dist/types/Interface/api/zendesk/QueryTicket.d.ts +39 -0
  22. package/dist/types/Interface/api/zendesk/QueryTicket.d.ts.map +1 -0
  23. package/dist/types/Interface/api/zendesk/QueryTicket.js +244 -0
  24. package/dist/types/Interface/api/zendesk/QueryTicket.js.map +1 -0
  25. package/dist/types/Interface/api/zendesk/ReadTicket.d.ts +99 -0
  26. package/dist/types/Interface/api/zendesk/ReadTicket.d.ts.map +1 -0
  27. package/dist/types/Interface/api/zendesk/ReadTicket.js +2 -0
  28. package/dist/types/Interface/api/zendesk/ReadTicket.js.map +1 -0
  29. package/dist/types/index.d.ts +3 -0
  30. package/dist/types/index.d.ts.map +1 -1
  31. package/dist/types/index.js +3 -0
  32. package/dist/types/index.js.map +1 -1
  33. package/package.json +1 -1
  34. package/ts/api/resources/HumanResourceLibrary.ts +13 -0
  35. package/ts/api/resources/Library.ts +0 -9
  36. package/ts/api/resources/zendesk/Ticket.ts +58 -0
  37. package/ts/api/resources.ts +2 -0
  38. package/ts/types/Enum/Zendesk.ts +56 -0
  39. package/ts/types/Interface/api/zendesk/QueryTicket.ts +193 -0
  40. package/ts/types/Interface/api/zendesk/ReadTicket.ts +110 -0
  41. package/ts/types/index.ts +3 -0
@@ -24,6 +24,19 @@ export class HumanResourceLibrary extends Resource {
24
24
  });
25
25
  }
26
26
 
27
+ /**
28
+ * Télécharge un document par son ID (identique au pattern fiche d'accès).
29
+ * À préférer à download({ fileURL }) pour les fichiers dans resources-internal.
30
+ */
31
+ downloadById(id: number): Promise<Blob> {
32
+ return this.axios.$get(`library-rh/${id}/buffer`, {
33
+ responseType: 'arraybuffer',
34
+ headers: {
35
+ Accept: 'application/pdf',
36
+ },
37
+ });
38
+ }
39
+
27
40
  public getAllHistory(id: number): Promise<IUserHumanResourceLibrary[]> {
28
41
  return this.axios.$get(`/library-rh/history/${id}`);
29
42
  }
@@ -62,15 +62,6 @@ export class Library extends Resource {
62
62
  });
63
63
  }
64
64
 
65
- exportDepartureDocuments(idSociety: number, idExercice: number): Promise<Blob> {
66
- return this.axios.$get(`/societies/${idSociety}/library/exercices/${idExercice}/departure-export`, {
67
- responseType: 'blob',
68
- headers: {
69
- Accept: 'application/zip',
70
- },
71
- });
72
- }
73
-
74
65
  delete(idFile: number): Promise<number> {
75
66
  return this.axios.$delete(`/library/file/${idFile}`);
76
67
  }
@@ -0,0 +1,58 @@
1
+ import {
2
+ CreateZendeskTicket,
3
+ UpdateZendeskTicket,
4
+ ListZendeskTickets,
5
+ TicketZendeskResponse,
6
+ SearchZendeskResponse,
7
+ TicketFormEnriched,
8
+ TicketZendesk,
9
+ } from '../../../index.js';
10
+ import { Resource } from '../../Resource.js';
11
+
12
+ export class ZendeskTicket extends Resource {
13
+ getPaginate(query: ListZendeskTickets): Promise<TicketZendeskResponse | SearchZendeskResponse> {
14
+ return this.axios.$get('connectors/zendesk/tickets', { params: query });
15
+ }
16
+
17
+ getForms(): Promise<TicketFormEnriched[]> {
18
+ return this.axios.$get('connectors/zendesk/tickets/forms');
19
+ }
20
+
21
+ get(id: number): Promise<TicketZendesk> {
22
+ return this.axios.$get(`connectors/zendesk/tickets/${id}`);
23
+ }
24
+
25
+ create(data: CreateZendeskTicket, file?: File): Promise<TicketZendesk> {
26
+ const formData = new FormData();
27
+ Object.entries(data).forEach(([key, value]) => {
28
+ if (value) {
29
+ formData.append(key, `${value}`);
30
+ }
31
+ });
32
+
33
+ if (file) {
34
+ formData.append('file', file);
35
+ }
36
+
37
+ return this.axios.$post('connectors/zendesk/tickets', formData, {
38
+ headers: { 'Content-Type': 'multipart/form-data' },
39
+ });
40
+ }
41
+
42
+ update(id: number, data: UpdateZendeskTicket): Promise<TicketZendesk> {
43
+ return this.axios.$put(`connectors/zendesk/tickets/${id}`, data);
44
+ }
45
+
46
+ delete(id: number): Promise<void> {
47
+ return this.axios.$delete(`connectors/zendesk/tickets/${id}`);
48
+ }
49
+
50
+ uploadAttachment(file: File): Promise<string> {
51
+ const formData = new FormData();
52
+ formData.append('file', file);
53
+
54
+ return this.axios.$post(`connectors/zendesk/tickets/upload`, formData, {
55
+ headers: { 'Content-Type': 'multipart/form-data' },
56
+ });
57
+ }
58
+ }
@@ -191,6 +191,7 @@ import { Acd } from './resources/Acd.js';
191
191
  import { UsersHistory } from './resources/UsersHistory.js';
192
192
  import { Zendesk } from './resources/zendesk/Zendesk.js';
193
193
  import { Formalism } from './resources/Formalism.js';
194
+ import { ZendeskTicket } from './resources/zendesk/Ticket.js';
194
195
  import { Vialink } from './resources/Vialink.js';
195
196
  import { KycMandate } from './resources/KycMandate.js';
196
197
 
@@ -388,6 +389,7 @@ export const resources = {
388
389
  acd: Acd,
389
390
  zendesk: Zendesk,
390
391
  formalism: Formalism,
392
+ zendeskTicket: ZendeskTicket,
391
393
  vialink: Vialink,
392
394
  kycMandate: KycMandate,
393
395
  };
@@ -0,0 +1,56 @@
1
+ export type ZendeskTicketStatus = 'new' | 'open' | 'pending' | 'hold' | 'solved' | 'closed';
2
+ export type ZendeskTicketPriority = 'urgent' | 'high' | 'normal' | 'low';
3
+ export type ZendeskTicketType = 'problem' | 'incident' | 'question' | 'task';
4
+ export type ZendeskTicketChannel =
5
+ | 'api'
6
+ | 'chat'
7
+ | 'email'
8
+ | 'facebook'
9
+ | 'mobile'
10
+ | 'native_messaging'
11
+ | 'sample_ticket'
12
+ | 'sms'
13
+ | 'twitter'
14
+ | 'voice'
15
+ | 'web'
16
+ | 'web_service'
17
+ | 'whatsapp';
18
+
19
+ export enum ZendeskTicketStatusEnum {
20
+ NEW = 'new',
21
+ OPEN = 'open',
22
+ PENDING = 'pending',
23
+ HOLD = 'hold',
24
+ SOLVED = 'solved',
25
+ CLOSED = 'closed',
26
+ }
27
+
28
+ export enum ZendeskTicketPriorityEnum {
29
+ URGENT = 'urgent',
30
+ HIGH = 'high',
31
+ NORMAL = 'normal',
32
+ LOW = 'low',
33
+ }
34
+
35
+ export enum ZendeskTicketTypeEnum {
36
+ PROBLEM = 'problem',
37
+ INCIDENT = 'incident',
38
+ QUESTION = 'question',
39
+ TASK = 'task',
40
+ }
41
+
42
+ export enum ZendeskTicketChannelEnum {
43
+ API = 'api',
44
+ CHAT = 'chat',
45
+ EMAIL = 'email',
46
+ FACEBOOK = 'facebook',
47
+ MOBILE = 'mobile',
48
+ NATIVE_MESSAGING = 'native_messaging',
49
+ SAMPLE_TICKET = 'sample_ticket',
50
+ SMS = 'sms',
51
+ TWITTER = 'twitter',
52
+ VOICE = 'voice',
53
+ WEB = 'web',
54
+ WEB_SERVICE = 'web_service',
55
+ WHATSAPP = 'whatsapp',
56
+ }
@@ -0,0 +1,193 @@
1
+ import {
2
+ IsString,
3
+ IsNotEmpty,
4
+ IsOptional,
5
+ IsEnum,
6
+ IsArray,
7
+ IsNumber,
8
+ MinLength,
9
+ IsInt,
10
+ Min,
11
+ Max,
12
+ IsDateString,
13
+ } from 'class-validator';
14
+ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
15
+ import {
16
+ ZendeskTicketChannel,
17
+ ZendeskTicketChannelEnum,
18
+ ZendeskTicketPriority,
19
+ ZendeskTicketPriorityEnum,
20
+ ZendeskTicketStatus,
21
+ ZendeskTicketStatusEnum,
22
+ ZendeskTicketType,
23
+ ZendeskTicketTypeEnum,
24
+ } from '../../../../types/Enum/Zendesk.js';
25
+
26
+ export class CreateZendeskTicket {
27
+ @ApiProperty()
28
+ @IsString()
29
+ @IsNotEmpty()
30
+ @MinLength(3)
31
+ subject: string;
32
+
33
+ @ApiProperty()
34
+ @IsString()
35
+ @IsNotEmpty()
36
+ body: string;
37
+
38
+ @ApiPropertyOptional()
39
+ @IsOptional()
40
+ @IsArray()
41
+ @IsString({ each: true })
42
+ attachments?: string[];
43
+
44
+ @ApiPropertyOptional()
45
+ @IsOptional()
46
+ @IsEnum(ZendeskTicketStatusEnum)
47
+ status?: ZendeskTicketStatus;
48
+
49
+ @ApiPropertyOptional()
50
+ @IsOptional()
51
+ @IsEnum(ZendeskTicketPriorityEnum)
52
+ priority?: ZendeskTicketPriority;
53
+
54
+ @ApiPropertyOptional()
55
+ @IsOptional()
56
+ @IsEnum(ZendeskTicketTypeEnum)
57
+ type?: ZendeskTicketType;
58
+
59
+ @ApiPropertyOptional()
60
+ @IsOptional()
61
+ @IsArray()
62
+ @IsString({ each: true })
63
+ tags?: string[];
64
+
65
+ @ApiPropertyOptional()
66
+ @IsOptional()
67
+ @IsNumber()
68
+ requesterId?: number;
69
+
70
+ @ApiPropertyOptional()
71
+ @IsOptional()
72
+ @IsNumber()
73
+ assigneeId?: number;
74
+
75
+ @ApiPropertyOptional()
76
+ @IsOptional()
77
+ @IsNumber()
78
+ groupId?: number;
79
+
80
+ @ApiPropertyOptional()
81
+ @IsOptional()
82
+ @IsNumber()
83
+ organizationId?: number;
84
+ }
85
+
86
+ export class UpdateZendeskTicket {
87
+ @ApiPropertyOptional()
88
+ @IsOptional()
89
+ @IsString()
90
+ @MinLength(3)
91
+ subject?: string;
92
+
93
+ @ApiPropertyOptional()
94
+ @IsOptional()
95
+ @IsString()
96
+ body?: string;
97
+
98
+ @ApiPropertyOptional()
99
+ @IsOptional()
100
+ @IsArray()
101
+ @IsString({ each: true })
102
+ attachments?: string[];
103
+
104
+ @ApiPropertyOptional()
105
+ @IsOptional()
106
+ @IsEnum(ZendeskTicketStatusEnum)
107
+ status?: ZendeskTicketStatus;
108
+
109
+ @ApiPropertyOptional()
110
+ @IsOptional()
111
+ @IsEnum(ZendeskTicketPriorityEnum)
112
+ priority?: ZendeskTicketPriority;
113
+
114
+ @ApiPropertyOptional()
115
+ @IsOptional()
116
+ @IsEnum(ZendeskTicketTypeEnum)
117
+ type?: ZendeskTicketType;
118
+
119
+ @ApiPropertyOptional()
120
+ @IsOptional()
121
+ @IsArray()
122
+ @IsString({ each: true })
123
+ tags?: string[];
124
+
125
+ @ApiPropertyOptional()
126
+ @IsOptional()
127
+ @IsNumber()
128
+ assigneeId?: number;
129
+
130
+ @ApiPropertyOptional()
131
+ @IsOptional()
132
+ @IsNumber()
133
+ groupId?: number;
134
+
135
+ @ApiPropertyOptional()
136
+ @IsOptional()
137
+ @IsNumber()
138
+ organizationId?: number;
139
+
140
+ @ApiPropertyOptional()
141
+ @IsOptional()
142
+ @IsNumber()
143
+ authorId?: number;
144
+ }
145
+
146
+ export class ListZendeskTickets {
147
+ @ApiProperty()
148
+ @IsEnum(ZendeskTicketChannelEnum)
149
+ channel: ZendeskTicketChannel;
150
+
151
+ @ApiPropertyOptional()
152
+ @IsOptional()
153
+ @IsEnum(ZendeskTicketStatusEnum)
154
+ status?: ZendeskTicketStatus;
155
+
156
+ @ApiPropertyOptional()
157
+ @IsOptional()
158
+ @IsInt()
159
+ @Min(1)
160
+ page?: number = 1;
161
+
162
+ @ApiPropertyOptional()
163
+ @IsOptional()
164
+ @IsInt()
165
+ @Min(1)
166
+ @Max(100)
167
+ limit?: number = 25;
168
+
169
+ @ApiPropertyOptional()
170
+ @IsOptional()
171
+ @IsString()
172
+ search?: string;
173
+
174
+ @ApiPropertyOptional()
175
+ @IsOptional()
176
+ @IsDateString()
177
+ startDate?: string;
178
+
179
+ @ApiPropertyOptional()
180
+ @IsOptional()
181
+ @IsDateString()
182
+ endDate?: string;
183
+
184
+ @ApiPropertyOptional()
185
+ @IsOptional()
186
+ @IsString()
187
+ sortBy?: string;
188
+
189
+ @ApiPropertyOptional()
190
+ @IsOptional()
191
+ @IsEnum(['asc', 'desc'])
192
+ sortOrder?: 'asc' | 'desc';
193
+ }
@@ -0,0 +1,110 @@
1
+ import {
2
+ ZendeskTicketChannel,
3
+ ZendeskTicketPriority,
4
+ ZendeskTicketStatus,
5
+ ZendeskTicketType,
6
+ } from '#types/Enum/Zendesk.js';
7
+
8
+ export interface TicketZendesk {
9
+ id: number;
10
+ url: string;
11
+ subject: string;
12
+ description: string;
13
+ comments: TicketComment[];
14
+ status: ZendeskTicketStatus;
15
+ priority: ZendeskTicketPriority | null;
16
+ type: ZendeskTicketType | null;
17
+ tags: string[];
18
+ via: { channel: ZendeskTicketChannel };
19
+ requesterId: number;
20
+ assigneeId: number | null;
21
+ groupId: number | null;
22
+ organizationId: number | null;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ }
26
+
27
+ export interface SearchZendeskResponse {
28
+ results: TicketZendesk[];
29
+ count: number;
30
+ nextPage: string | null;
31
+ previousPage: string | null;
32
+ }
33
+
34
+ export interface TicketZendeskResponse {
35
+ results: TicketZendesk[];
36
+ count: number;
37
+ nextPage: string | null;
38
+ previousPage: string | null;
39
+ }
40
+
41
+ export interface CustomFieldZendeskOption {
42
+ id: number;
43
+ name: string;
44
+ rawName: string;
45
+ value: string;
46
+ default: boolean;
47
+ }
48
+
49
+ export interface TicketFieldZendesk {
50
+ id: number;
51
+ url: string;
52
+ type: string;
53
+ title: string;
54
+ rawTitle: string;
55
+ description: string;
56
+ position: number;
57
+ active: boolean;
58
+ required: boolean;
59
+ requiredInPortal: boolean;
60
+ visibleInPortal: boolean;
61
+ editableInPortal: boolean;
62
+ tag: string | null;
63
+ customFieldOptions: CustomFieldZendeskOption[];
64
+ }
65
+
66
+ export interface TicketFormZendesk {
67
+ id: number;
68
+ url: string;
69
+ name: string;
70
+ rawName: string;
71
+ displayName: string;
72
+ rawDisplayName: string;
73
+ endUserVisible: boolean;
74
+ position: number;
75
+ active: boolean;
76
+ default: boolean;
77
+ inAllBrands: boolean;
78
+ restrictedBrandIds: number[];
79
+ ticketFieldIds: number[];
80
+ createdAt: string;
81
+ updatedAt: string;
82
+ }
83
+
84
+ export interface TicketFormEnriched extends Omit<TicketFormZendesk, 'ticketFieldIds'> {
85
+ fields: TicketFieldZendesk[];
86
+ }
87
+
88
+ export interface TicketAttachment {
89
+ id: number;
90
+ fileName: string;
91
+ contentUrl: string;
92
+ contentType: string;
93
+ size: number;
94
+ createdAt: string;
95
+ updatedAt: string;
96
+ }
97
+
98
+ export interface TicketComment {
99
+ id: number;
100
+ type: string;
101
+ authorId: number;
102
+ author: any;
103
+ body: string;
104
+ htmlBody: string;
105
+ plainBody: string;
106
+ public: boolean;
107
+ attachments: TicketAttachment[];
108
+ createdAt: string;
109
+ updatedAt: string;
110
+ }
package/ts/types/index.ts CHANGED
@@ -502,6 +502,7 @@ export * from './Enum/EquipmentAvailability.js';
502
502
  export * from './Enum/SpecialDayType.js';
503
503
  export * from './Enum/Degree.js';
504
504
  export * from './Enum/Brevo.js';
505
+ export * from './Enum/Zendesk.js';
505
506
  export * from './Enum/ZoneCode.js';
506
507
  export * from './Enum/TimeSlot.js';
507
508
  export * from './Enum/StateSynchro.js';
@@ -831,6 +832,8 @@ export * from './Interface/api/loan/ReadLoan.js';
831
832
  export * from './Interface/api/stock/StocksType.js';
832
833
  export * from './Interface/api/lettering/QueryRegroupLettering.js';
833
834
  export * from './Interface/api/loan/UpdateLoan.js';
835
+ export * from './Interface/api/zendesk/QueryTicket.js';
836
+ export * from './Interface/api/zendesk/ReadTicket.js';
834
837
  export * from './Interface/api/zticket/CreateZTicket.js';
835
838
  export * from './Interface/api/zticket/QueryZTicket.js';
836
839
  export * from './Interface/api/balanceSheetModule/CreateBalanceSheetModule.js';