File tree Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Expand file tree Collapse file tree 4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @polarsquad/cinode-api" ,
3
- "version" : " 0.12.5 " ,
3
+ "version" : " 0.12.6 " ,
4
4
"description" : " Cinode API for the Cinode platform" ,
5
5
"homepage" : " https://github.com/polarsquad/cinode-api#readme" ,
6
6
"bugs" : {
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
25
25
ProjectBase ,
26
26
ProjectPipeline ,
27
27
ProjectState ,
28
+ SearchProjectQuery ,
28
29
SearchResult ,
29
30
SearchSkillResult ,
30
31
TeamBase ,
@@ -66,7 +67,7 @@ export class Api {
66
67
. json < CompanyCustomer > ( ) ;
67
68
}
68
69
69
- async listAllProjects ( query = { } ) {
70
+ async listAllProjects ( query : SearchProjectQuery = { } ) {
70
71
const {
71
72
pagedAndSortedBy : { itemsPerPage } ,
72
73
totalItems,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import type {
19
19
ProjectBase ,
20
20
ProjectState ,
21
21
ProjectTeam ,
22
+ SearchProjectQuery ,
22
23
UserFilter ,
23
24
WithProfile ,
24
25
} from './types.js' ;
@@ -69,8 +70,8 @@ export class CinodeService {
69
70
this . backofficeTeams = backofficeTeams ;
70
71
}
71
72
72
- async getAllProjects ( ) {
73
- const projects = await this . api . listAllProjects ( ) ;
73
+ async getAllProjects ( query : SearchProjectQuery = { } ) {
74
+ const projects = await this . api . listAllProjects ( query ) ;
74
75
return Promise . all (
75
76
projects . flatMap ( ( p ) => ( p ?. id ? [ this . getProject ( p . id ) ] : [ ] ) )
76
77
) ;
Original file line number Diff line number Diff line change @@ -180,6 +180,21 @@ export enum ProjectState {
180
180
Suspended = 60 ,
181
181
}
182
182
183
+ export enum SortByProject {
184
+ CreatedDateTime = 0 ,
185
+ Title = 1 ,
186
+ Identifier = 2 ,
187
+ CustomerIdentifier = 3 ,
188
+ SeoId = 4 ,
189
+ UpdatedDateTime = 5 ,
190
+ LastTouchDateTime = 6 ,
191
+ }
192
+
193
+ export enum SortOrder {
194
+ Ascending = 0 ,
195
+ Descending = 1 ,
196
+ }
197
+
183
198
export enum Status {
184
199
Inactive = 0 ,
185
200
Active = 1 ,
@@ -1267,6 +1282,27 @@ export interface Role {
1267
1282
level ?: AccessLevel | null ;
1268
1283
}
1269
1284
1285
+ interface PageAndSortByProject {
1286
+ sortBy ?: SortByProject ;
1287
+ sortOrder ?: SortOrder ;
1288
+ page ?: number ;
1289
+ itemsPerPage ?: number ;
1290
+ }
1291
+
1292
+ export interface SearchProjectQuery {
1293
+ title ?: string ;
1294
+ identification ?: string ;
1295
+ customerIdentifier ?: string ;
1296
+ corporateIdentityNumber ?: string ;
1297
+ customerId ?: number ;
1298
+ pageAndSortBy ?: PageAndSortByProject ;
1299
+ pipelines ?: number [ ] ;
1300
+ salesManagers ?: number [ ] ;
1301
+ customers ?: number [ ] ;
1302
+ intermediators ?: number [ ] ;
1303
+ projectStates ?: ProjectState [ ] ;
1304
+ }
1305
+
1270
1306
export interface SearchSkill {
1271
1307
keywordId ?: number | null ;
1272
1308
min ?: number | null ;
You can’t perform that action at this time.
0 commit comments