@orchesty/connector-pinya 1.0.0

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 (56) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +190 -0
  3. package/coverage/clover.xml +167 -0
  4. package/coverage/coverage-final.json +6 -0
  5. package/coverage/lcov-report/base.css +224 -0
  6. package/coverage/lcov-report/block-navigation.js +87 -0
  7. package/coverage/lcov-report/favicon.png +0 -0
  8. package/coverage/lcov-report/index.html +161 -0
  9. package/coverage/lcov-report/prettify.css +1 -0
  10. package/coverage/lcov-report/prettify.js +2 -0
  11. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  12. package/coverage/lcov-report/sorter.js +210 -0
  13. package/coverage/lcov-report/src/Batch/PinyaAbsencesBatch.ts.html +346 -0
  14. package/coverage/lcov-report/src/Batch/PinyaEmployeesBatch.ts.html +835 -0
  15. package/coverage/lcov-report/src/Batch/index.html +131 -0
  16. package/coverage/lcov-report/src/Connector/PinyaJobTitlesConnector.ts.html +220 -0
  17. package/coverage/lcov-report/src/Connector/index.html +116 -0
  18. package/coverage/lcov-report/src/PinyaApplication.ts.html +643 -0
  19. package/coverage/lcov-report/src/index.html +116 -0
  20. package/coverage/lcov-report/test/dataProvider.ts.html +280 -0
  21. package/coverage/lcov-report/test/index.html +116 -0
  22. package/coverage/lcov.info +257 -0
  23. package/dist/Batch/PinyaAbsencesBatch.d.ts +33 -0
  24. package/dist/Batch/PinyaAbsencesBatch.js +54 -0
  25. package/dist/Batch/PinyaEmployeesBatch.d.ts +207 -0
  26. package/dist/Batch/PinyaEmployeesBatch.js +44 -0
  27. package/dist/Connector/PinyaJobTitlesConnector.d.ts +15 -0
  28. package/dist/Connector/PinyaJobTitlesConnector.js +21 -0
  29. package/dist/PinyaApplication.d.ts +26 -0
  30. package/dist/PinyaApplication.js +149 -0
  31. package/dist/package.json +22 -0
  32. package/jest.config.js +13 -0
  33. package/package.json +22 -0
  34. package/src/Batch/PinyaAbsencesBatch.ts +87 -0
  35. package/src/Batch/PinyaEmployeesBatch.ts +250 -0
  36. package/src/Batch/__tests__/Data/PinyaAbsencesBatch/empty-input.json +6 -0
  37. package/src/Batch/__tests__/Data/PinyaAbsencesBatch/empty-mock.json +9 -0
  38. package/src/Batch/__tests__/Data/PinyaAbsencesBatch/empty-output.json +7 -0
  39. package/src/Batch/__tests__/Data/PinyaAbsencesBatch/input.json +6 -0
  40. package/src/Batch/__tests__/Data/PinyaAbsencesBatch/mock.json +26 -0
  41. package/src/Batch/__tests__/Data/PinyaAbsencesBatch/output.json +11 -0
  42. package/src/Batch/__tests__/Data/PinyaEmployeesBatch/input.json +6 -0
  43. package/src/Batch/__tests__/Data/PinyaEmployeesBatch/mock.json +203 -0
  44. package/src/Batch/__tests__/Data/PinyaEmployeesBatch/output.json +11 -0
  45. package/src/Batch/__tests__/PinyaAbsencesBatch.ts +21 -0
  46. package/src/Batch/__tests__/PinyaEmployeesBatch.ts +17 -0
  47. package/src/Connector/PinyaJobTitlesConnector.ts +45 -0
  48. package/src/Connector/__tests__/Data/PinyaJobTitlesConnector/input.json +6 -0
  49. package/src/Connector/__tests__/Data/PinyaJobTitlesConnector/mock.json +20 -0
  50. package/src/Connector/__tests__/Data/PinyaJobTitlesConnector/output.json +14 -0
  51. package/src/Connector/__tests__/PinyaJobTitlesConnector.ts +17 -0
  52. package/src/PinyaApplication.ts +186 -0
  53. package/test/dataProvider.ts +65 -0
  54. package/tsconfig.json +8 -0
  55. package/tsconfig.prod.json +13 -0
  56. package/tsconfig.prod.tsbuildinfo +1 -0
@@ -0,0 +1,257 @@
1
+ TN:
2
+ SF:src/PinyaApplication.ts
3
+ FN:28,(anonymous_10)
4
+ FN:32,(anonymous_11)
5
+ FN:36,(anonymous_12)
6
+ FN:40,(anonymous_13)
7
+ FN:44,(anonymous_14)
8
+ FN:53,(anonymous_15)
9
+ FN:61,(anonymous_16)
10
+ FN:82,(anonymous_17)
11
+ FN:86,(anonymous_18)
12
+ FN:116,(anonymous_19)
13
+ FN:133,(anonymous_20)
14
+ FN:158,(anonymous_21)
15
+ FN:174,(anonymous_22)
16
+ FNF:13
17
+ FNH:5
18
+ FNDA:3,(anonymous_10)
19
+ FNDA:7,(anonymous_11)
20
+ FNDA:0,(anonymous_12)
21
+ FNDA:0,(anonymous_13)
22
+ FNDA:0,(anonymous_14)
23
+ FNDA:0,(anonymous_15)
24
+ FNDA:4,(anonymous_16)
25
+ FNDA:0,(anonymous_17)
26
+ FNDA:4,(anonymous_18)
27
+ FNDA:4,(anonymous_19)
28
+ FNDA:0,(anonymous_20)
29
+ FNDA:0,(anonymous_21)
30
+ FNDA:0,(anonymous_22)
31
+ DA:1,3
32
+ DA:3,3
33
+ DA:4,3
34
+ DA:5,3
35
+ DA:6,3
36
+ DA:7,3
37
+ DA:9,3
38
+ DA:11,3
39
+ DA:13,3
40
+ DA:14,3
41
+ DA:16,3
42
+ DA:18,3
43
+ DA:19,3
44
+ DA:20,3
45
+ DA:21,3
46
+ DA:23,3
47
+ DA:24,3
48
+ DA:26,3
49
+ DA:28,3
50
+ DA:29,3
51
+ DA:33,7
52
+ DA:37,0
53
+ DA:41,0
54
+ DA:45,0
55
+ DA:50,0
56
+ DA:54,0
57
+ DA:56,0
58
+ DA:68,4
59
+ DA:69,4
60
+ DA:75,4
61
+ DA:76,0
62
+ DA:79,4
63
+ DA:83,0
64
+ DA:91,4
65
+ DA:93,4
66
+ DA:108,4
67
+ DA:117,4
68
+ DA:118,4
69
+ DA:119,4
70
+ DA:121,4
71
+ DA:123,4
72
+ DA:125,0
73
+ DA:130,4
74
+ DA:137,0
75
+ DA:147,0
76
+ DA:149,0
77
+ DA:158,3
78
+ DA:159,0
79
+ DA:160,0
80
+ DA:167,0
81
+ DA:168,0
82
+ DA:175,0
83
+ DA:176,0
84
+ DA:177,0
85
+ LF:54
86
+ LH:35
87
+ BRDA:56,0,0,0
88
+ BRDA:56,0,1,0
89
+ BRDA:56,0,2,0
90
+ BRDA:75,1,0,0
91
+ BRDA:75,1,1,4
92
+ BRDA:123,2,0,0
93
+ BRDA:123,2,1,4
94
+ BRDA:174,3,0,0
95
+ BRF:8
96
+ BRH:2
97
+ end_of_record
98
+ TN:
99
+ SF:src/Batch/PinyaAbsencesBatch.ts
100
+ FN:9,(anonymous_1)
101
+ FN:13,(anonymous_2)
102
+ FN:17,(anonymous_3)
103
+ FN:45,(anonymous_4)
104
+ FN:52,(anonymous_5)
105
+ FN:56,(anonymous_6)
106
+ FNF:6
107
+ FNH:6
108
+ FNDA:3,(anonymous_1)
109
+ FNDA:3,(anonymous_2)
110
+ FNDA:2,(anonymous_3)
111
+ FNDA:2,(anonymous_4)
112
+ FNDA:2,(anonymous_5)
113
+ FNDA:2,(anonymous_6)
114
+ DA:1,3
115
+ DA:2,3
116
+ DA:5,3
117
+ DA:7,3
118
+ DA:9,3
119
+ DA:10,3
120
+ DA:14,3
121
+ DA:18,2
122
+ DA:20,2
123
+ DA:26,2
124
+ DA:27,2
125
+ DA:28,2
126
+ DA:29,1
127
+ DA:39,2
128
+ DA:40,2
129
+ DA:42,2
130
+ DA:46,2
131
+ DA:48,2
132
+ DA:53,2
133
+ DA:57,2
134
+ DA:58,0
135
+ DA:60,2
136
+ LF:22
137
+ LH:21
138
+ BRDA:9,0,0,3
139
+ BRDA:9,1,0,3
140
+ BRDA:28,2,0,1
141
+ BRDA:28,2,1,1
142
+ BRDA:57,3,0,0
143
+ BRDA:57,3,1,2
144
+ BRF:6
145
+ BRH:5
146
+ end_of_record
147
+ TN:
148
+ SF:src/Batch/PinyaEmployeesBatch.ts
149
+ FN:9,(anonymous_1)
150
+ FN:13,(anonymous_2)
151
+ FN:17,(anonymous_3)
152
+ FN:34,(anonymous_4)
153
+ FN:41,(anonymous_5)
154
+ FN:45,(anonymous_6)
155
+ FNF:6
156
+ FNH:6
157
+ FNDA:3,(anonymous_1)
158
+ FNDA:3,(anonymous_2)
159
+ FNDA:1,(anonymous_3)
160
+ FNDA:1,(anonymous_4)
161
+ FNDA:1,(anonymous_5)
162
+ FNDA:1,(anonymous_6)
163
+ DA:1,3
164
+ DA:2,3
165
+ DA:5,3
166
+ DA:7,3
167
+ DA:9,3
168
+ DA:10,3
169
+ DA:14,3
170
+ DA:18,1
171
+ DA:20,1
172
+ DA:26,1
173
+ DA:27,1
174
+ DA:28,1
175
+ DA:29,1
176
+ DA:31,1
177
+ DA:35,1
178
+ DA:37,1
179
+ DA:42,1
180
+ DA:46,1
181
+ DA:47,0
182
+ DA:49,1
183
+ LF:20
184
+ LH:19
185
+ BRDA:9,0,0,3
186
+ BRDA:9,1,0,3
187
+ BRDA:46,2,0,0
188
+ BRDA:46,2,1,1
189
+ BRF:4
190
+ BRH:3
191
+ end_of_record
192
+ TN:
193
+ SF:src/Connector/PinyaJobTitlesConnector.ts
194
+ FN:9,(anonymous_1)
195
+ FN:13,(anonymous_2)
196
+ FNF:2
197
+ FNH:2
198
+ FNDA:3,(anonymous_1)
199
+ FNDA:1,(anonymous_2)
200
+ DA:1,3
201
+ DA:2,3
202
+ DA:5,3
203
+ DA:7,3
204
+ DA:10,3
205
+ DA:14,1
206
+ DA:20,1
207
+ DA:21,1
208
+ DA:23,1
209
+ LF:9
210
+ LH:9
211
+ BRF:0
212
+ BRH:0
213
+ end_of_record
214
+ TN:
215
+ SF:test/dataProvider.ts
216
+ FN:15,initPinyaIntegrationTest
217
+ FNF:1
218
+ FNH:1
219
+ FNDA:3,initPinyaIntegrationTest
220
+ DA:1,3
221
+ DA:2,3
222
+ DA:3,3
223
+ DA:4,3
224
+ DA:5,3
225
+ DA:6,3
226
+ DA:7,3
227
+ DA:8,3
228
+ DA:9,3
229
+ DA:10,3
230
+ DA:11,3
231
+ DA:12,3
232
+ DA:13,3
233
+ DA:15,3
234
+ DA:16,3
235
+ DA:17,3
236
+ DA:18,3
237
+ DA:24,3
238
+ DA:25,0
239
+ DA:27,3
240
+ DA:29,3
241
+ DA:30,0
242
+ DA:32,3
243
+ DA:34,3
244
+ DA:35,3
245
+ DA:37,3
246
+ DA:43,3
247
+ DA:49,3
248
+ DA:56,3
249
+ LF:29
250
+ LH:27
251
+ BRDA:24,0,0,0
252
+ BRDA:24,0,1,3
253
+ BRDA:29,1,0,0
254
+ BRDA:29,1,1,3
255
+ BRF:4
256
+ BRH:2
257
+ end_of_record
@@ -0,0 +1,33 @@
1
+ import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
2
+ import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
3
+ export declare const PINYA_ABSENCES_BATCH = "pinya-absences-batch";
4
+ export default class PinyaAbsencesBatch extends ABatchNode {
5
+ protected batchSize: number;
6
+ constructor(resultAsBatch?: boolean, batchSize?: number);
7
+ getName(): string;
8
+ processAction(dto: BatchProcessDto): Promise<BatchProcessDto>;
9
+ protected processFilter(dto: BatchProcessDto): string;
10
+ protected processResult(dto: BatchProcessDto, response: Response): Promise<BatchProcessDto>;
11
+ protected doPagination(dto: BatchProcessDto, response: Response): void;
12
+ }
13
+ export interface PinyaAbsencesOutput {
14
+ id: number;
15
+ dateFrom: string;
16
+ dateTo: string;
17
+ absenceState: string;
18
+ amount: number;
19
+ description: string;
20
+ employeeNumber: string;
21
+ absenceTypeCode: string;
22
+ absenceTypeTitle: string;
23
+ absenceTypeShortcut: string;
24
+ isWorktime: boolean;
25
+ }
26
+ export interface Response {
27
+ pageNumber: number;
28
+ pageSize: number;
29
+ lastPage: number;
30
+ totalItemsCount: number;
31
+ count: number;
32
+ data: PinyaAbsencesOutput[];
33
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PINYA_ABSENCES_BATCH = void 0;
7
+ const ABatchNode_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode"));
8
+ const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
9
+ exports.PINYA_ABSENCES_BATCH = 'pinya-absences-batch';
10
+ class PinyaAbsencesBatch extends ABatchNode_1.default {
11
+ batchSize;
12
+ constructor(resultAsBatch = false, batchSize = 50) {
13
+ super(resultAsBatch);
14
+ this.batchSize = batchSize;
15
+ }
16
+ getName() {
17
+ return exports.PINYA_ABSENCES_BATCH;
18
+ }
19
+ async processAction(dto) {
20
+ const appInstall = await this.getApplicationInstallFromProcess(dto);
21
+ const req = await this.getApplication().getRequestDto(dto, appInstall, HttpMethods_1.HttpMethods.GET, `absences?${this.processFilter(dto)}`);
22
+ const resp = await this.getSender().send(req, { success: ['<300', '404'] });
23
+ let response = resp.getJsonBody();
24
+ if (!('data' in response)) {
25
+ response = {
26
+ pageNumber: 0,
27
+ pageSize: 1,
28
+ lastPage: 0,
29
+ totalItemsCount: 0,
30
+ count: 0,
31
+ data: [],
32
+ };
33
+ }
34
+ await this.processResult(dto, response);
35
+ this.doPagination(dto, response);
36
+ return dto;
37
+ }
38
+ processFilter(dto) {
39
+ const page = Number(dto.getBatchCursor('0'));
40
+ return `PageNumber=${page}&PageSize=${this.batchSize}`;
41
+ }
42
+ async processResult(dto, response) {
43
+ return dto.setItemList(response.data, this.resultAsBatch);
44
+ }
45
+ doPagination(dto, response) {
46
+ if (response.lastPage > response.pageNumber) {
47
+ dto.setBatchCursor((response.pageNumber + 1).toString());
48
+ }
49
+ else {
50
+ dto.removeBatchCursor();
51
+ }
52
+ }
53
+ }
54
+ exports.default = PinyaAbsencesBatch;
@@ -0,0 +1,207 @@
1
+ import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
2
+ import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
3
+ export declare const PINYA_EMPLOYEES_BATCH = "pinya-employees-batch";
4
+ export default class PinyaEmployeesBatch extends ABatchNode {
5
+ protected batchSize: number;
6
+ constructor(resultAsBatch?: boolean, batchSize?: number);
7
+ getName(): string;
8
+ processAction(dto: BatchProcessDto): Promise<BatchProcessDto>;
9
+ protected processFilter(dto: BatchProcessDto): string;
10
+ protected processResult(dto: BatchProcessDto, response: Response): Promise<BatchProcessDto>;
11
+ protected doPagination(dto: BatchProcessDto, response: Response): void;
12
+ }
13
+ export interface PinyaEmployeesOutput {
14
+ employeeBasic: {
15
+ employeeGuid: string;
16
+ employeeNumber: string;
17
+ startDate: string;
18
+ endDate: string;
19
+ terminationWay: string;
20
+ terminationReason: string;
21
+ firstname: string;
22
+ lastname: string;
23
+ middlename: string;
24
+ isFabisActivated?: boolean;
25
+ degrees: string;
26
+ degreesBehind: string;
27
+ workEmail: string;
28
+ workPhoneNumber: string;
29
+ workMobilePhoneNumber: string;
30
+ languageSkills: {
31
+ id: number;
32
+ title: string;
33
+ code: string;
34
+ }[];
35
+ computerSkills: {
36
+ id: number;
37
+ title: string;
38
+ code: string;
39
+ }[];
40
+ skills: string;
41
+ contractNumber: string;
42
+ contractStartDate: string;
43
+ endOfProbation: string;
44
+ contractEndDate: string;
45
+ contractType: {
46
+ id: number;
47
+ title: string;
48
+ code: string;
49
+ };
50
+ contractValidity: string;
51
+ fte: number;
52
+ employmentStatus: {
53
+ id: number;
54
+ title: string;
55
+ code: string;
56
+ };
57
+ company: {
58
+ id: number;
59
+ title: string;
60
+ code: string;
61
+ };
62
+ location: {
63
+ id: number;
64
+ title: string;
65
+ code: string;
66
+ };
67
+ workplace: {
68
+ id: number;
69
+ title: string;
70
+ code: string;
71
+ };
72
+ division: {
73
+ id: number;
74
+ title: string;
75
+ code: string;
76
+ };
77
+ department: {
78
+ id: number;
79
+ title: string;
80
+ code: string;
81
+ };
82
+ jobTitle: {
83
+ id: number;
84
+ title: string;
85
+ code: string;
86
+ };
87
+ jobLevel: {
88
+ id: number;
89
+ title: string;
90
+ code: string;
91
+ };
92
+ specialization: {
93
+ id: number;
94
+ title: string;
95
+ code: string;
96
+ };
97
+ superior: {
98
+ employeeGuid: string;
99
+ employeeNumber: string;
100
+ employeeName: string;
101
+ };
102
+ approver: {
103
+ employeeGuid: string;
104
+ employeeNumber: string;
105
+ employeeName: string;
106
+ };
107
+ dayShift: number;
108
+ weekHours: number;
109
+ hoursSchedule: string;
110
+ vacationClaim: number;
111
+ unpaidLeaveClaim: number;
112
+ sickDaysClaim: number;
113
+ homeOfficeClaim: number;
114
+ };
115
+ employeePersonal: {
116
+ birthDate: string;
117
+ gender: {
118
+ id: number;
119
+ title: string;
120
+ code: string;
121
+ };
122
+ maritalStatus: {
123
+ id: number;
124
+ title: string;
125
+ code: string;
126
+ };
127
+ nationality: string;
128
+ healthInsuranceProvider: {
129
+ id: number;
130
+ title: string;
131
+ code: string;
132
+ };
133
+ healthInsuranceNumber: string;
134
+ taxNumber: string;
135
+ personalEmail: string;
136
+ maidenname: string;
137
+ birthCertNumber: string;
138
+ birthPlace: string;
139
+ numberOfChildren: number;
140
+ street: string;
141
+ houseNumber: string;
142
+ postalCode: string;
143
+ city: string;
144
+ country: string;
145
+ contactStreet: string;
146
+ contactHouseNumber: string;
147
+ contactPostalCode: string;
148
+ contactCity: string;
149
+ contactCountry: string;
150
+ personalPhoneNumber: string;
151
+ emergencyName: string;
152
+ emergencyPhone: string;
153
+ idCardNumber: string;
154
+ idCardValidTo: string;
155
+ passportNumber: string;
156
+ passportValidTo: string;
157
+ drivingLicenceNumber: string;
158
+ drivingLicenceValidTo: string;
159
+ drivingLicenceGroup: string;
160
+ bankName: string;
161
+ bankPrefix: string;
162
+ bankAccount: string;
163
+ bankCode: string;
164
+ iban: string;
165
+ customFields: {
166
+ additionalProp1: string;
167
+ additionalProp2: string;
168
+ additionalProp3: string;
169
+ };
170
+ };
171
+ employeeWage: {
172
+ currency: {
173
+ id: number;
174
+ title: string;
175
+ code: string;
176
+ };
177
+ basicWage: number;
178
+ personalBonus: number;
179
+ grossWage: number;
180
+ netWage: number;
181
+ hourlyWage: number;
182
+ agreementExpenses: number;
183
+ invoiceExpenses: number;
184
+ expenses: number;
185
+ transportationBonus: number;
186
+ retirementInsurrance: number;
187
+ otherBonus: number;
188
+ bonus: {
189
+ id: number;
190
+ title: string;
191
+ code: string;
192
+ };
193
+ customFields: {
194
+ additionalProp1: string;
195
+ additionalProp2: string;
196
+ additionalProp3: string;
197
+ };
198
+ };
199
+ }
200
+ export interface Response {
201
+ pageNumber: number;
202
+ pageSize: number;
203
+ lastPage: number;
204
+ totalItemsCount: number;
205
+ count: number;
206
+ data: PinyaEmployeesOutput[];
207
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PINYA_EMPLOYEES_BATCH = void 0;
7
+ const ABatchNode_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode"));
8
+ const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
9
+ exports.PINYA_EMPLOYEES_BATCH = 'pinya-employees-batch';
10
+ class PinyaEmployeesBatch extends ABatchNode_1.default {
11
+ batchSize;
12
+ constructor(resultAsBatch = false, batchSize = 50) {
13
+ super(resultAsBatch);
14
+ this.batchSize = batchSize;
15
+ }
16
+ getName() {
17
+ return exports.PINYA_EMPLOYEES_BATCH;
18
+ }
19
+ async processAction(dto) {
20
+ const appInstall = await this.getApplicationInstallFromProcess(dto);
21
+ const req = await this.getApplication().getRequestDto(dto, appInstall, HttpMethods_1.HttpMethods.GET, `employees?${this.processFilter(dto)}`);
22
+ const resp = await this.getSender().send(req);
23
+ const response = resp.getJsonBody();
24
+ await this.processResult(dto, response);
25
+ this.doPagination(dto, response);
26
+ return dto;
27
+ }
28
+ processFilter(dto) {
29
+ const page = Number(dto.getBatchCursor('0'));
30
+ return `PageNumber=${page}&PageSize=${this.batchSize}`;
31
+ }
32
+ async processResult(dto, response) {
33
+ return dto.setItemList(response.data, this.resultAsBatch);
34
+ }
35
+ doPagination(dto, response) {
36
+ if (response.lastPage > response.pageNumber) {
37
+ dto.setBatchCursor((response.pageNumber + 1).toString());
38
+ }
39
+ else {
40
+ dto.removeBatchCursor();
41
+ }
42
+ }
43
+ }
44
+ exports.default = PinyaEmployeesBatch;
@@ -0,0 +1,15 @@
1
+ import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
+ import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
3
+ export declare const PINYA_JOB_TITLES_CONNECTOR = "pinya-job-titles";
4
+ export declare class PinyaJobTitlesConnector extends AConnector {
5
+ getName(): string;
6
+ processAction(dto: ProcessDto): Promise<ProcessDto<PinyaJobTitlesOutput>>;
7
+ }
8
+ export interface PinyaJobTitle {
9
+ id: number;
10
+ title: string;
11
+ code: string;
12
+ description: string;
13
+ note: string;
14
+ }
15
+ export type PinyaJobTitlesOutput = PinyaJobTitle[];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PinyaJobTitlesConnector = exports.PINYA_JOB_TITLES_CONNECTOR = void 0;
7
+ const AConnector_1 = __importDefault(require("@orchesty/nodejs-sdk/dist/lib/Connector/AConnector"));
8
+ const HttpMethods_1 = require("@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods");
9
+ exports.PINYA_JOB_TITLES_CONNECTOR = 'pinya-job-titles';
10
+ class PinyaJobTitlesConnector extends AConnector_1.default {
11
+ getName() {
12
+ return exports.PINYA_JOB_TITLES_CONNECTOR;
13
+ }
14
+ async processAction(dto) {
15
+ const req = await this.getApplication().getRequestDto(dto, await this.getApplicationInstallFromProcess(dto), HttpMethods_1.HttpMethods.GET, 'system/job-titles?PageNumber=0&PageSize=150');
16
+ const resp = await this.getSender().send(req, [200]);
17
+ const titles = resp.getJsonBody().data;
18
+ return dto.setNewJsonData(titles);
19
+ }
20
+ }
21
+ exports.PinyaJobTitlesConnector = PinyaJobTitlesConnector;
@@ -0,0 +1,26 @@
1
+ import { ApplicationInstall } from '@orchesty/nodejs-sdk/dist/lib/Application/Database/ApplicationInstall';
2
+ import FormStack from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FormStack';
3
+ import { ABasicApplication } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
4
+ import CacheService from '@orchesty/nodejs-sdk/dist/lib/Cache/CacheService';
5
+ import RequestDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/RequestDto';
6
+ import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
7
+ import AProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/AProcessDto';
8
+ export declare const PINYA_APPLICATION = "pinya";
9
+ export declare const accessCacheKey = "pinya-accessKey";
10
+ export declare const accessLockKey = "pinya-accessKey-lock";
11
+ export default class PinyaApplication extends ABasicApplication {
12
+ private readonly cache;
13
+ constructor(cache: CacheService);
14
+ getName(): string;
15
+ getPublicName(): string;
16
+ getDescription(): string;
17
+ getFormStack(): FormStack;
18
+ isAuthorized(applicationInstall: ApplicationInstall): boolean;
19
+ getRequestDto(dto: AProcessDto, applicationInstall: ApplicationInstall, method: HttpMethods, url?: string, data?: unknown): Promise<RequestDto>;
20
+ getLogo(): string;
21
+ private accessToken;
22
+ private getAccessToken;
23
+ private accessTokenByRefreshToken;
24
+ private readonly accessCallBack;
25
+ private getExpirationWithOffset;
26
+ }