@orchesty/connector-sage-hr 1.0.0 → 1.0.1
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/package.json +4 -1
- package/package.json +4 -1
- package/CHANGELOG.md +0 -7
- package/coverage/clover.xml +0 -100
- package/coverage/coverage-final.json +0 -5
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/Batch/SageHrGetProjectsBatch.ts.html +0 -229
- package/coverage/lcov-report/src/Batch/SageHrListEmployeesBatch.ts.html +0 -370
- package/coverage/lcov-report/src/Batch/index.html +0 -131
- package/coverage/lcov-report/src/SageHrApplication.ts.html +0 -301
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/test/dataProvider.ts.html +0 -175
- package/coverage/lcov-report/test/index.html +0 -116
- package/coverage/lcov.info +0 -147
- package/jest.config.js +0 -13
- package/src/Batch/SageHrGetProjectsBatch.ts +0 -48
- package/src/Batch/SageHrListEmployeesBatch.ts +0 -95
- package/src/Batch/__tests__/Data/SageHrGetProjectsBatch/input.json +0 -6
- package/src/Batch/__tests__/Data/SageHrGetProjectsBatch/mock.json +0 -18
- package/src/Batch/__tests__/Data/SageHrGetProjectsBatch/output.json +0 -15
- package/src/Batch/__tests__/Data/SageHrListEmployeesBatch/input.json +0 -6
- package/src/Batch/__tests__/Data/SageHrListEmployeesBatch/mock.json +0 -66
- package/src/Batch/__tests__/Data/SageHrListEmployeesBatch/output.json +0 -11
- package/src/Batch/__tests__/SageHrGetProjectsBatch.ts +0 -17
- package/src/Batch/__tests__/SageHrListEmployeesBatch.ts +0 -17
- package/src/SageHrApplication.ts +0 -72
- package/test/dataProvider.ts +0 -30
- package/tsconfig.json +0 -8
- package/tsconfig.prod.json +0 -13
- package/tsconfig.prod.tsbuildinfo +0 -1
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for test</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../index.html">All files</a> test</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">100% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>16/16</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">100% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>0/0</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>1/1</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">100% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>16/16</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line high'></div>
|
|
65
|
-
<div class="pad1">
|
|
66
|
-
<table class="coverage-summary">
|
|
67
|
-
<thead>
|
|
68
|
-
<tr>
|
|
69
|
-
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
70
|
-
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
71
|
-
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
72
|
-
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
-
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
74
|
-
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
75
|
-
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
76
|
-
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
77
|
-
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
78
|
-
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
79
|
-
</tr>
|
|
80
|
-
</thead>
|
|
81
|
-
<tbody><tr>
|
|
82
|
-
<td class="file high" data-value="dataProvider.ts"><a href="dataProvider.ts.html">dataProvider.ts</a></td>
|
|
83
|
-
<td data-value="100" class="pic high">
|
|
84
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
|
-
</td>
|
|
86
|
-
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="16" class="abs high">16/16</td>
|
|
88
|
-
<td data-value="100" class="pct high">100%</td>
|
|
89
|
-
<td data-value="0" class="abs high">0/0</td>
|
|
90
|
-
<td data-value="100" class="pct high">100%</td>
|
|
91
|
-
<td data-value="1" class="abs high">1/1</td>
|
|
92
|
-
<td data-value="100" class="pct high">100%</td>
|
|
93
|
-
<td data-value="16" class="abs high">16/16</td>
|
|
94
|
-
</tr>
|
|
95
|
-
|
|
96
|
-
</tbody>
|
|
97
|
-
</table>
|
|
98
|
-
</div>
|
|
99
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
100
|
-
</div><!-- /wrapper -->
|
|
101
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
102
|
-
Code coverage generated by
|
|
103
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
104
|
-
at 2026-01-15T09:49:54.402Z
|
|
105
|
-
</div>
|
|
106
|
-
<script src="../prettify.js"></script>
|
|
107
|
-
<script>
|
|
108
|
-
window.onload = function () {
|
|
109
|
-
prettyPrint();
|
|
110
|
-
};
|
|
111
|
-
</script>
|
|
112
|
-
<script src="../sorter.js"></script>
|
|
113
|
-
<script src="../block-navigation.js"></script>
|
|
114
|
-
</body>
|
|
115
|
-
</html>
|
|
116
|
-
|
package/coverage/lcov.info
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
TN:
|
|
2
|
-
SF:src/SageHrApplication.ts
|
|
3
|
-
FN:18,(anonymous_10)
|
|
4
|
-
FN:22,(anonymous_11)
|
|
5
|
-
FN:26,(anonymous_12)
|
|
6
|
-
FN:30,(anonymous_13)
|
|
7
|
-
FN:34,(anonymous_14)
|
|
8
|
-
FN:59,(anonymous_15)
|
|
9
|
-
FN:67,(anonymous_16)
|
|
10
|
-
FNF:7
|
|
11
|
-
FNH:2
|
|
12
|
-
FNDA:4,(anonymous_10)
|
|
13
|
-
FNDA:0,(anonymous_11)
|
|
14
|
-
FNDA:0,(anonymous_12)
|
|
15
|
-
FNDA:0,(anonymous_13)
|
|
16
|
-
FNDA:2,(anonymous_14)
|
|
17
|
-
FNDA:0,(anonymous_15)
|
|
18
|
-
FNDA:0,(anonymous_16)
|
|
19
|
-
DA:1,2
|
|
20
|
-
DA:3,2
|
|
21
|
-
DA:4,2
|
|
22
|
-
DA:5,2
|
|
23
|
-
DA:6,2
|
|
24
|
-
DA:7,2
|
|
25
|
-
DA:8,2
|
|
26
|
-
DA:11,2
|
|
27
|
-
DA:13,2
|
|
28
|
-
DA:14,2
|
|
29
|
-
DA:15,2
|
|
30
|
-
DA:16,2
|
|
31
|
-
DA:19,4
|
|
32
|
-
DA:23,0
|
|
33
|
-
DA:27,0
|
|
34
|
-
DA:31,0
|
|
35
|
-
DA:41,2
|
|
36
|
-
DA:42,2
|
|
37
|
-
DA:43,2
|
|
38
|
-
DA:44,2
|
|
39
|
-
DA:45,2
|
|
40
|
-
DA:46,2
|
|
41
|
-
DA:52,2
|
|
42
|
-
DA:53,0
|
|
43
|
-
DA:56,2
|
|
44
|
-
DA:60,0
|
|
45
|
-
DA:64,0
|
|
46
|
-
DA:68,0
|
|
47
|
-
DA:69,0
|
|
48
|
-
LF:29
|
|
49
|
-
LH:21
|
|
50
|
-
BRDA:45,0,0,2
|
|
51
|
-
BRDA:45,0,1,0
|
|
52
|
-
BRDA:52,1,0,0
|
|
53
|
-
BRDA:52,1,1,2
|
|
54
|
-
BRDA:69,2,0,0
|
|
55
|
-
BRDA:69,2,1,0
|
|
56
|
-
BRF:6
|
|
57
|
-
BRH:2
|
|
58
|
-
end_of_record
|
|
59
|
-
TN:
|
|
60
|
-
SF:src/Batch/SageHrGetProjectsBatch.ts
|
|
61
|
-
FN:9,(anonymous_1)
|
|
62
|
-
FN:13,(anonymous_2)
|
|
63
|
-
FNF:2
|
|
64
|
-
FNH:2
|
|
65
|
-
FNDA:2,(anonymous_1)
|
|
66
|
-
FNDA:1,(anonymous_2)
|
|
67
|
-
DA:1,2
|
|
68
|
-
DA:2,2
|
|
69
|
-
DA:5,2
|
|
70
|
-
DA:7,2
|
|
71
|
-
DA:10,2
|
|
72
|
-
DA:14,1
|
|
73
|
-
DA:15,1
|
|
74
|
-
DA:16,1
|
|
75
|
-
DA:22,1
|
|
76
|
-
DA:23,1
|
|
77
|
-
DA:25,1
|
|
78
|
-
DA:26,1
|
|
79
|
-
DA:27,0
|
|
80
|
-
DA:30,1
|
|
81
|
-
LF:14
|
|
82
|
-
LH:13
|
|
83
|
-
BRDA:25,0,0,1
|
|
84
|
-
BRDA:25,0,1,0
|
|
85
|
-
BRDA:26,1,0,0
|
|
86
|
-
BRDA:26,1,1,1
|
|
87
|
-
BRF:4
|
|
88
|
-
BRH:2
|
|
89
|
-
end_of_record
|
|
90
|
-
TN:
|
|
91
|
-
SF:src/Batch/SageHrListEmployeesBatch.ts
|
|
92
|
-
FN:9,(anonymous_1)
|
|
93
|
-
FN:13,(anonymous_2)
|
|
94
|
-
FNF:2
|
|
95
|
-
FNH:2
|
|
96
|
-
FNDA:2,(anonymous_1)
|
|
97
|
-
FNDA:1,(anonymous_2)
|
|
98
|
-
DA:1,2
|
|
99
|
-
DA:2,2
|
|
100
|
-
DA:5,2
|
|
101
|
-
DA:7,2
|
|
102
|
-
DA:10,2
|
|
103
|
-
DA:14,1
|
|
104
|
-
DA:15,1
|
|
105
|
-
DA:16,1
|
|
106
|
-
DA:22,1
|
|
107
|
-
DA:23,1
|
|
108
|
-
DA:25,1
|
|
109
|
-
DA:26,1
|
|
110
|
-
DA:27,0
|
|
111
|
-
DA:30,1
|
|
112
|
-
LF:14
|
|
113
|
-
LH:13
|
|
114
|
-
BRDA:25,0,0,1
|
|
115
|
-
BRDA:25,0,1,0
|
|
116
|
-
BRDA:26,1,0,0
|
|
117
|
-
BRDA:26,1,1,1
|
|
118
|
-
BRF:4
|
|
119
|
-
BRH:2
|
|
120
|
-
end_of_record
|
|
121
|
-
TN:
|
|
122
|
-
SF:test/dataProvider.ts
|
|
123
|
-
FN:8,init
|
|
124
|
-
FNF:1
|
|
125
|
-
FNH:1
|
|
126
|
-
FNDA:2,init
|
|
127
|
-
DA:1,2
|
|
128
|
-
DA:2,2
|
|
129
|
-
DA:3,2
|
|
130
|
-
DA:4,2
|
|
131
|
-
DA:5,2
|
|
132
|
-
DA:6,2
|
|
133
|
-
DA:8,2
|
|
134
|
-
DA:9,2
|
|
135
|
-
DA:15,2
|
|
136
|
-
DA:17,2
|
|
137
|
-
DA:18,2
|
|
138
|
-
DA:19,2
|
|
139
|
-
DA:20,2
|
|
140
|
-
DA:24,2
|
|
141
|
-
DA:25,2
|
|
142
|
-
DA:29,2
|
|
143
|
-
LF:16
|
|
144
|
-
LH:16
|
|
145
|
-
BRF:0
|
|
146
|
-
BRH:0
|
|
147
|
-
end_of_record
|
package/jest.config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const baseConfig = require('../../jest.config.js');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
...baseConfig,
|
|
5
|
-
roots: ["<rootDir>/src"],
|
|
6
|
-
setupFiles: ["<rootDir>/../../.jest/testEnvs.ts"],
|
|
7
|
-
setupFilesAfterEnv: ["<rootDir>/../../.jest/testLifecycle.ts"],
|
|
8
|
-
globalSetup: "<rootDir>/../../.jest/globalSetup.ts",
|
|
9
|
-
moduleNameMapper: {
|
|
10
|
-
"^@orchesty/nodejs-connectors/test/(.*)$": "<rootDir>/../../test/$1",
|
|
11
|
-
"^@orchesty/nodejs-connectors/lib/(.*)$": "<rootDir>/../../lib/$1",
|
|
12
|
-
},
|
|
13
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
2
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
3
|
-
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
4
|
-
|
|
5
|
-
export const NAME = 'sage-hr-get-projects-batch';
|
|
6
|
-
|
|
7
|
-
export default class SageHrGetProjectsBatch extends ABatchNode {
|
|
8
|
-
|
|
9
|
-
public getName(): string {
|
|
10
|
-
return NAME;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public async processAction(dto: BatchProcessDto): Promise<BatchProcessDto> {
|
|
14
|
-
const page = dto.getBatchCursor('1');
|
|
15
|
-
const appInstall = await this.getApplicationInstallFromProcess(dto);
|
|
16
|
-
const req = await this.getApplication().getRequestDto(
|
|
17
|
-
dto,
|
|
18
|
-
appInstall,
|
|
19
|
-
HttpMethods.GET,
|
|
20
|
-
`timesheets/projects?page=${page}`,
|
|
21
|
-
);
|
|
22
|
-
const resp = await this.getSender().send<IResponse>(req, [200]);
|
|
23
|
-
const response = resp.getJsonBody();
|
|
24
|
-
|
|
25
|
-
dto.setItemList(response.errors ?? []);
|
|
26
|
-
if (response.meta.current_page < response.meta.total_pages) {
|
|
27
|
-
dto.setBatchCursor(response.meta.next_page.toString());
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return dto;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
36
|
-
|
|
37
|
-
interface IResponse {
|
|
38
|
-
errors: string[];
|
|
39
|
-
meta: {
|
|
40
|
-
current_page: number;
|
|
41
|
-
next_page: number;
|
|
42
|
-
total_pages: number;
|
|
43
|
-
per_page: number;
|
|
44
|
-
total_entries: number;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
2
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
3
|
-
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
4
|
-
|
|
5
|
-
export const NAME = 'sage-hr-list-employees-batch';
|
|
6
|
-
|
|
7
|
-
export default class SageHrListEmployeesBatch extends ABatchNode {
|
|
8
|
-
|
|
9
|
-
public getName(): string {
|
|
10
|
-
return NAME;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public async processAction(dto: BatchProcessDto): Promise<BatchProcessDto> {
|
|
14
|
-
const page = dto.getBatchCursor('1');
|
|
15
|
-
const appInstall = await this.getApplicationInstallFromProcess(dto);
|
|
16
|
-
const req = await this.getApplication().getRequestDto(
|
|
17
|
-
dto,
|
|
18
|
-
appInstall,
|
|
19
|
-
HttpMethods.GET,
|
|
20
|
-
`employees?page=${page}`,
|
|
21
|
-
);
|
|
22
|
-
const resp = await this.getSender().send<IResponse>(req, [200]);
|
|
23
|
-
const response = resp.getJsonBody();
|
|
24
|
-
|
|
25
|
-
dto.setItemList(response.data ?? []);
|
|
26
|
-
if (response.meta.current_page < response.meta.total_pages) {
|
|
27
|
-
dto.setBatchCursor(response.meta.next_page.toString());
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return dto;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
36
|
-
|
|
37
|
-
interface IResponse {
|
|
38
|
-
data: IOutput[];
|
|
39
|
-
meta: {
|
|
40
|
-
current_page: number;
|
|
41
|
-
next_page: number;
|
|
42
|
-
total_pages: number;
|
|
43
|
-
per_page: number;
|
|
44
|
-
total_entries: number;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface IOutput {
|
|
49
|
-
data: {
|
|
50
|
-
id: number;
|
|
51
|
-
email: string;
|
|
52
|
-
first_name: string;
|
|
53
|
-
last_name: string;
|
|
54
|
-
picture_url: string;
|
|
55
|
-
employment_start_date: string;
|
|
56
|
-
date_of_birth: string;
|
|
57
|
-
team: string;
|
|
58
|
-
team_id: number;
|
|
59
|
-
position: string;
|
|
60
|
-
position_id: number;
|
|
61
|
-
reports_to_employee_id: number;
|
|
62
|
-
work_phone: string;
|
|
63
|
-
home_phone: string;
|
|
64
|
-
mobile_phone: string;
|
|
65
|
-
gender: string;
|
|
66
|
-
street_first: string;
|
|
67
|
-
street_second: string;
|
|
68
|
-
city: string;
|
|
69
|
-
post_code: number;
|
|
70
|
-
country: string;
|
|
71
|
-
employee_number: string;
|
|
72
|
-
employment_status: string;
|
|
73
|
-
team_history: {
|
|
74
|
-
team_id: number;
|
|
75
|
-
start_date: string;
|
|
76
|
-
end_date: string;
|
|
77
|
-
team_name: string;
|
|
78
|
-
}[];
|
|
79
|
-
employment_status_history: {
|
|
80
|
-
employment_status_id: number;
|
|
81
|
-
start_date: string;
|
|
82
|
-
end_date: string;
|
|
83
|
-
employment_statu_name: string;
|
|
84
|
-
}[];
|
|
85
|
-
position_history: {
|
|
86
|
-
position_id: number;
|
|
87
|
-
start_date: string;
|
|
88
|
-
end_date: string;
|
|
89
|
-
position_name: string;
|
|
90
|
-
position_code: string;
|
|
91
|
-
}[];
|
|
92
|
-
}[];
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "GET https://companydomain.sage.hr/api/timesheets/projects?page=1",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"errors": [
|
|
6
|
-
"error 1",
|
|
7
|
-
"error 2"
|
|
8
|
-
],
|
|
9
|
-
"meta": {
|
|
10
|
-
"current_page": 1,
|
|
11
|
-
"next_page": 1,
|
|
12
|
-
"previous_page": null,
|
|
13
|
-
"total_pages": 1,
|
|
14
|
-
"per_page": 50,
|
|
15
|
-
"total_entries": 75
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "GET https://companydomain.sage.hr/api/employees?page=1",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"data": [
|
|
6
|
-
{
|
|
7
|
-
"id": 19,
|
|
8
|
-
"email": "john@example.com",
|
|
9
|
-
"first_name": "John",
|
|
10
|
-
"last_name": "Doe",
|
|
11
|
-
"picture_url": "https://example.com/john.png",
|
|
12
|
-
"employment_start_date": "2014-08-25",
|
|
13
|
-
"date_of_birth": "1991-02-13",
|
|
14
|
-
"team": "Sage HR",
|
|
15
|
-
"team_id": 1,
|
|
16
|
-
"position": "Api developer",
|
|
17
|
-
"position_id": 123,
|
|
18
|
-
"reports_to_employee_id": 5,
|
|
19
|
-
"work_phone": "555-0505",
|
|
20
|
-
"home_phone": "555-0506",
|
|
21
|
-
"mobile_phone": "555-0507",
|
|
22
|
-
"gender": "Male",
|
|
23
|
-
"street_first": "84 Glenwood Street",
|
|
24
|
-
"street_second": "Peoria",
|
|
25
|
-
"city": "London",
|
|
26
|
-
"post_code": 99999,
|
|
27
|
-
"country": "GB",
|
|
28
|
-
"employee_number": "A01",
|
|
29
|
-
"employment_status": "Full-time",
|
|
30
|
-
"team_history": [
|
|
31
|
-
{
|
|
32
|
-
"team_id": 1,
|
|
33
|
-
"start_date": "2018-01-01",
|
|
34
|
-
"end_date": "201-01-01",
|
|
35
|
-
"team_name": "Some Team"
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
"employment_status_history": [
|
|
39
|
-
{
|
|
40
|
-
"employment_status_id": 1,
|
|
41
|
-
"start_date": "2018-01-01",
|
|
42
|
-
"end_date": "201-01-01",
|
|
43
|
-
"employment_statu_name": "Full time"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"position_history": [
|
|
47
|
-
{
|
|
48
|
-
"position_id": 1,
|
|
49
|
-
"start_date": "2018-01-01",
|
|
50
|
-
"end_date": "201-01-01",
|
|
51
|
-
"position_name": "Developer",
|
|
52
|
-
"position_code": "1234"
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"meta": {
|
|
58
|
-
"current_page": 1,
|
|
59
|
-
"next_page": 1,
|
|
60
|
-
"previous_page": null,
|
|
61
|
-
"total_pages": 1,
|
|
62
|
-
"per_page": 50,
|
|
63
|
-
"total_entries": 75
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"headers": {
|
|
3
|
-
"user": "TestUser"
|
|
4
|
-
},
|
|
5
|
-
"data": [
|
|
6
|
-
{
|
|
7
|
-
"body": "{\"id\":19,\"email\":\"john@example.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"picture_url\":\"https://example.com/john.png\",\"employment_start_date\":\"2014-08-25\",\"date_of_birth\":\"1991-02-13\",\"team\":\"Sage HR\",\"team_id\":1,\"position\":\"Api developer\",\"position_id\":123,\"reports_to_employee_id\":5,\"work_phone\":\"555-0505\",\"home_phone\":\"555-0506\",\"mobile_phone\":\"555-0507\",\"gender\":\"Male\",\"street_first\":\"84 Glenwood Street\",\"street_second\":\"Peoria\",\"city\":\"London\",\"post_code\":99999,\"country\":\"GB\",\"employee_number\":\"A01\",\"employment_status\":\"Full-time\",\"team_history\":[{\"team_id\":1,\"start_date\":\"2018-01-01\",\"end_date\":\"201-01-01\",\"team_name\":\"Some Team\"}],\"employment_status_history\":[{\"employment_status_id\":1,\"start_date\":\"2018-01-01\",\"end_date\":\"201-01-01\",\"employment_statu_name\":\"Full time\"}],\"position_history\":[{\"position_id\":1,\"start_date\":\"2018-01-01\",\"end_date\":\"201-01-01\",\"position_name\":\"Developer\",\"position_code\":\"1234\"}]}",
|
|
8
|
-
"headers": {}
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
2
|
-
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
-
import init from '../../../test/dataProvider';
|
|
4
|
-
import { NAME as SAGE_HR_GET_PROJECTS_BATCH } from '../SageHrGetProjectsBatch';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for SageHrGetProjectsBatch', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testBatch(SAGE_HR_GET_PROJECTS_BATCH);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
2
|
-
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
-
import init from '../../../test/dataProvider';
|
|
4
|
-
import { NAME as SAGE_HR_LIST_EMPLOYEES_BATCH } from '../SageHrListEmployeesBatch';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for SageHrListEmployeesBatch', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testBatch(SAGE_HR_LIST_EMPLOYEES_BATCH);
|
|
16
|
-
});
|
|
17
|
-
});
|
package/src/SageHrApplication.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import CoreFormsEnum, { getFormName } from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
|
|
2
|
-
import { ApplicationInstall } from '@orchesty/nodejs-sdk/dist/lib/Application/Database/ApplicationInstall';
|
|
3
|
-
import Field from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Field';
|
|
4
|
-
import FieldType from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FieldType';
|
|
5
|
-
import Form from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Form';
|
|
6
|
-
import FormStack from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FormStack';
|
|
7
|
-
import { ABasicApplication } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
|
|
8
|
-
import RequestDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/RequestDto';
|
|
9
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
10
|
-
import AProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/AProcessDto';
|
|
11
|
-
import { CommonHeaders, JSON_TYPE } from '@orchesty/nodejs-sdk/dist/lib/Utils/Headers';
|
|
12
|
-
|
|
13
|
-
export const SUBDOMAIN = 'subdomain';
|
|
14
|
-
export const NAME = 'sage-hr';
|
|
15
|
-
export const API_KEY = 'api_key';
|
|
16
|
-
export default class SageHrApplication extends ABasicApplication {
|
|
17
|
-
|
|
18
|
-
public getName(): string {
|
|
19
|
-
return NAME;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public getPublicName(): string {
|
|
23
|
-
return 'SageHR';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public getDescription(): string {
|
|
27
|
-
return 'Cloud based human resources management solution that helps you remotely track, manage and engage your employees as easily as you do in the office';
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public getLogo(): string {
|
|
31
|
-
return 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4K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go8L3N2Zz4K';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public getRequestDto(
|
|
35
|
-
dto: AProcessDto,
|
|
36
|
-
applicationInstall: ApplicationInstall,
|
|
37
|
-
method: HttpMethods,
|
|
38
|
-
uri?: string,
|
|
39
|
-
data?: unknown,
|
|
40
|
-
): RequestDto {
|
|
41
|
-
const settings = applicationInstall.getSettings();
|
|
42
|
-
const key = settings[CoreFormsEnum.AUTHORIZATION_FORM][API_KEY];
|
|
43
|
-
const subdomain = settings[CoreFormsEnum.AUTHORIZATION_FORM][SUBDOMAIN];
|
|
44
|
-
const url = `https://${subdomain}.sage.hr/api/${uri}`;
|
|
45
|
-
const request = new RequestDto(url ?? '', method, dto);
|
|
46
|
-
request.setHeaders({
|
|
47
|
-
[CommonHeaders.CONTENT_TYPE]: JSON_TYPE,
|
|
48
|
-
[CommonHeaders.ACCEPT]: JSON_TYPE,
|
|
49
|
-
'X-Auth-Token': key, // eslint-disable-line
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
if (data) {
|
|
53
|
-
request.setJsonBody(data);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return request;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public getFormStack(): FormStack {
|
|
60
|
-
const form = new Form(CoreFormsEnum.AUTHORIZATION_FORM, getFormName(CoreFormsEnum.AUTHORIZATION_FORM))
|
|
61
|
-
.addField(new Field(FieldType.TEXT, SUBDOMAIN, 'Subdomain', undefined, true))
|
|
62
|
-
.addField(new Field(FieldType.TEXT, API_KEY, 'API key', undefined, true));
|
|
63
|
-
|
|
64
|
-
return new FormStack().addForm(form);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public isAuthorized(applicationInstall: ApplicationInstall): boolean {
|
|
68
|
-
const authorizationForm = applicationInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM];
|
|
69
|
-
return authorizationForm?.[SUBDOMAIN] && authorizationForm?.[API_KEY];
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|