@orchesty/connector-workable 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 -102
- 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/WorkableGetAccountsBatch.ts.html +0 -235
- package/coverage/lcov-report/src/Batch/WorkableJobsBatch.ts.html +0 -322
- package/coverage/lcov-report/src/Batch/index.html +0 -131
- package/coverage/lcov-report/src/WorkableApplication.ts.html +0 -295
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/test/dataProvider.ts.html +0 -193
- package/coverage/lcov-report/test/index.html +0 -116
- package/coverage/lcov.info +0 -145
- package/jest.config.js +0 -13
- package/src/Batch/WorkableGetAccountsBatch.ts +0 -50
- package/src/Batch/WorkableJobsBatch.ts +0 -79
- package/src/Batch/__tests__/Data/WorkableGetAccountsBatch/input.json +0 -7
- package/src/Batch/__tests__/Data/WorkableGetAccountsBatch/mock.json +0 -16
- package/src/Batch/__tests__/Data/WorkableGetAccountsBatch/output.json +0 -11
- package/src/Batch/__tests__/Data/WorkableJobsBatch/input.json +0 -8
- package/src/Batch/__tests__/Data/WorkableJobsBatch/mock.json +0 -58
- package/src/Batch/__tests__/Data/WorkableJobsBatch/output.json +0 -15
- package/src/Batch/__tests__/WorkableGetAccountsBatch.ts +0 -17
- package/src/Batch/__tests__/WorkableJobsBatch.ts +0 -17
- package/src/WorkableApplication.ts +0 -70
- package/test/dataProvider.ts +0 -36
- 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'>17/17</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'>17/17</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="17" class="abs high">17/17</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="17" class="abs high">17/17</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:45:33.433Z
|
|
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,145 +0,0 @@
|
|
|
1
|
-
TN:
|
|
2
|
-
SF:src/WorkableApplication.ts
|
|
3
|
-
FN:19,(anonymous_10)
|
|
4
|
-
FN:23,(anonymous_11)
|
|
5
|
-
FN:27,(anonymous_12)
|
|
6
|
-
FN:31,(anonymous_13)
|
|
7
|
-
FN:35,(anonymous_14)
|
|
8
|
-
FN:43,(anonymous_15)
|
|
9
|
-
FN:48,(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:0,(anonymous_14)
|
|
17
|
-
FNDA:0,(anonymous_15)
|
|
18
|
-
FNDA:2,(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:9,2
|
|
27
|
-
DA:12,2
|
|
28
|
-
DA:14,2
|
|
29
|
-
DA:15,2
|
|
30
|
-
DA:17,2
|
|
31
|
-
DA:20,4
|
|
32
|
-
DA:24,0
|
|
33
|
-
DA:28,0
|
|
34
|
-
DA:32,0
|
|
35
|
-
DA:36,0
|
|
36
|
-
DA:40,0
|
|
37
|
-
DA:44,0
|
|
38
|
-
DA:45,0
|
|
39
|
-
DA:55,2
|
|
40
|
-
DA:56,2
|
|
41
|
-
DA:57,2
|
|
42
|
-
DA:63,2
|
|
43
|
-
DA:64,0
|
|
44
|
-
DA:67,2
|
|
45
|
-
LF:26
|
|
46
|
-
LH:18
|
|
47
|
-
BRDA:45,0,0,0
|
|
48
|
-
BRDA:45,0,1,0
|
|
49
|
-
BRDA:63,1,0,0
|
|
50
|
-
BRDA:63,1,1,2
|
|
51
|
-
BRF:4
|
|
52
|
-
BRH:1
|
|
53
|
-
end_of_record
|
|
54
|
-
TN:
|
|
55
|
-
SF:src/Batch/WorkableGetAccountsBatch.ts
|
|
56
|
-
FN:11,(anonymous_1)
|
|
57
|
-
FN:15,(anonymous_2)
|
|
58
|
-
FNF:2
|
|
59
|
-
FNH:2
|
|
60
|
-
FNDA:2,(anonymous_1)
|
|
61
|
-
FNDA:1,(anonymous_2)
|
|
62
|
-
DA:1,2
|
|
63
|
-
DA:2,2
|
|
64
|
-
DA:3,2
|
|
65
|
-
DA:5,2
|
|
66
|
-
DA:7,2
|
|
67
|
-
DA:9,2
|
|
68
|
-
DA:12,2
|
|
69
|
-
DA:16,1
|
|
70
|
-
DA:17,1
|
|
71
|
-
DA:18,1
|
|
72
|
-
DA:24,1
|
|
73
|
-
DA:25,1
|
|
74
|
-
DA:27,1
|
|
75
|
-
DA:28,1
|
|
76
|
-
DA:30,1
|
|
77
|
-
LF:15
|
|
78
|
-
LH:15
|
|
79
|
-
BRDA:27,0,0,1
|
|
80
|
-
BRDA:27,0,1,0
|
|
81
|
-
BRF:2
|
|
82
|
-
BRH:1
|
|
83
|
-
end_of_record
|
|
84
|
-
TN:
|
|
85
|
-
SF:src/Batch/WorkableJobsBatch.ts
|
|
86
|
-
FN:11,(anonymous_1)
|
|
87
|
-
FN:15,(anonymous_2)
|
|
88
|
-
FNF:2
|
|
89
|
-
FNH:2
|
|
90
|
-
FNDA:2,(anonymous_1)
|
|
91
|
-
FNDA:1,(anonymous_2)
|
|
92
|
-
DA:1,2
|
|
93
|
-
DA:2,2
|
|
94
|
-
DA:3,2
|
|
95
|
-
DA:5,2
|
|
96
|
-
DA:7,2
|
|
97
|
-
DA:9,2
|
|
98
|
-
DA:12,2
|
|
99
|
-
DA:16,1
|
|
100
|
-
DA:17,1
|
|
101
|
-
DA:18,1
|
|
102
|
-
DA:19,1
|
|
103
|
-
DA:25,1
|
|
104
|
-
DA:26,1
|
|
105
|
-
DA:28,1
|
|
106
|
-
DA:29,1
|
|
107
|
-
DA:30,0
|
|
108
|
-
DA:33,1
|
|
109
|
-
LF:17
|
|
110
|
-
LH:16
|
|
111
|
-
BRDA:28,0,0,1
|
|
112
|
-
BRDA:28,0,1,0
|
|
113
|
-
BRDA:29,1,0,0
|
|
114
|
-
BRDA:29,1,1,1
|
|
115
|
-
BRF:4
|
|
116
|
-
BRH:2
|
|
117
|
-
end_of_record
|
|
118
|
-
TN:
|
|
119
|
-
SF:test/dataProvider.ts
|
|
120
|
-
FN:11,init
|
|
121
|
-
FNF:1
|
|
122
|
-
FNH:1
|
|
123
|
-
FNDA:2,init
|
|
124
|
-
DA:1,2
|
|
125
|
-
DA:2,2
|
|
126
|
-
DA:5,2
|
|
127
|
-
DA:6,2
|
|
128
|
-
DA:7,2
|
|
129
|
-
DA:8,2
|
|
130
|
-
DA:9,2
|
|
131
|
-
DA:11,2
|
|
132
|
-
DA:12,2
|
|
133
|
-
DA:19,2
|
|
134
|
-
DA:20,2
|
|
135
|
-
DA:22,2
|
|
136
|
-
DA:23,2
|
|
137
|
-
DA:25,2
|
|
138
|
-
DA:29,2
|
|
139
|
-
DA:31,2
|
|
140
|
-
DA:35,2
|
|
141
|
-
LF:17
|
|
142
|
-
LH:17
|
|
143
|
-
BRF:0
|
|
144
|
-
BRH:0
|
|
145
|
-
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,50 +0,0 @@
|
|
|
1
|
-
import CoreFormsEnum from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
|
|
2
|
-
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
3
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
4
|
-
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
5
|
-
import { SUBDOMAIN } from '../WorkableApplication';
|
|
6
|
-
|
|
7
|
-
export const NAME = 'workable-get-accounts-batch';
|
|
8
|
-
|
|
9
|
-
export default class WorkableGetAccountsBatch extends ABatchNode {
|
|
10
|
-
|
|
11
|
-
public getName(): string {
|
|
12
|
-
return NAME;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public async processAction(dto: BatchProcessDto): Promise<BatchProcessDto> {
|
|
16
|
-
const appInstall = await this.getApplicationInstallFromProcess(dto);
|
|
17
|
-
const subdomain = appInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM][SUBDOMAIN];
|
|
18
|
-
const req = await this.getApplication().getRequestDto(
|
|
19
|
-
dto,
|
|
20
|
-
appInstall,
|
|
21
|
-
HttpMethods.GET,
|
|
22
|
-
`${subdomain}.workable.com/spi/v3/accounts`,
|
|
23
|
-
);
|
|
24
|
-
const resp = await this.getSender().send<IResponse>(req, [200]);
|
|
25
|
-
const response = resp.getJsonBody();
|
|
26
|
-
|
|
27
|
-
dto.setItemList(response.accounts ?? []);
|
|
28
|
-
dto.removeBatchCursor();
|
|
29
|
-
|
|
30
|
-
return dto;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
36
|
-
interface IResponse {
|
|
37
|
-
accounts: IOutput[];
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IOutput {
|
|
42
|
-
id: string;
|
|
43
|
-
name: string;
|
|
44
|
-
subdomain: string;
|
|
45
|
-
description: string;
|
|
46
|
-
summary: string;
|
|
47
|
-
website_url: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import CoreFormsEnum from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
|
|
2
|
-
import ABatchNode from '@orchesty/nodejs-sdk/dist/lib/Batch/ABatchNode';
|
|
3
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
4
|
-
import BatchProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/BatchProcessDto';
|
|
5
|
-
import { SUBDOMAIN } from '../WorkableApplication';
|
|
6
|
-
|
|
7
|
-
export const NAME = 'workable-jobs-batch';
|
|
8
|
-
|
|
9
|
-
export default class WorkableJobsBatch extends ABatchNode {
|
|
10
|
-
|
|
11
|
-
public getName(): string {
|
|
12
|
-
return NAME;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
public async processAction(dto: BatchProcessDto): Promise<BatchProcessDto> {
|
|
16
|
-
const appInstall = await this.getApplicationInstallFromProcess(dto);
|
|
17
|
-
const subdomain = appInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM][SUBDOMAIN];
|
|
18
|
-
const url = dto.getBatchCursor(`${subdomain}.workable.com/spi/v3/jobs?state=published`);
|
|
19
|
-
const req = await this.getApplication().getRequestDto(
|
|
20
|
-
dto,
|
|
21
|
-
appInstall,
|
|
22
|
-
HttpMethods.GET,
|
|
23
|
-
url,
|
|
24
|
-
);
|
|
25
|
-
const resp = await this.getSender().send<IResponse>(req, [200]);
|
|
26
|
-
const response = resp.getJsonBody();
|
|
27
|
-
|
|
28
|
-
dto.setItemList(response.jobs ?? []);
|
|
29
|
-
if (response.paging?.next) {
|
|
30
|
-
dto.setBatchCursor(response.paging.next);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return dto;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
39
|
-
|
|
40
|
-
export interface IInput {
|
|
41
|
-
subdomain: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface IResponse {
|
|
45
|
-
jobs: IOutput[];
|
|
46
|
-
paging: {
|
|
47
|
-
next: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
interface IOutput {
|
|
52
|
-
id: string;
|
|
53
|
-
title: string;
|
|
54
|
-
full_title: string;
|
|
55
|
-
shortcode: string;
|
|
56
|
-
code: string;
|
|
57
|
-
state: string;
|
|
58
|
-
department: string;
|
|
59
|
-
department_hierarchy: {
|
|
60
|
-
id: number;
|
|
61
|
-
name: string;
|
|
62
|
-
}[];
|
|
63
|
-
url: string;
|
|
64
|
-
application_url: string;
|
|
65
|
-
shortlink: string;
|
|
66
|
-
location: {
|
|
67
|
-
location_str: string;
|
|
68
|
-
country: string;
|
|
69
|
-
country_code: string;
|
|
70
|
-
region: string;
|
|
71
|
-
region_code: string;
|
|
72
|
-
city: string;
|
|
73
|
-
zip_code: string;
|
|
74
|
-
telecommuting: boolean;
|
|
75
|
-
};
|
|
76
|
-
created_at: string;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* eslint-enable @typescript-eslint/naming-convention */
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "GET https://hb-6.workable.com/spi/v3/accounts",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"accounts": [
|
|
6
|
-
{
|
|
7
|
-
"id": "8c061",
|
|
8
|
-
"name": "HB",
|
|
9
|
-
"subdomain": "hb-6",
|
|
10
|
-
"description": null,
|
|
11
|
-
"summary": null,
|
|
12
|
-
"website_url": "http://hb.cz"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "GET https://hb-6.workable.com/spi/v3/jobs?state=published",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"jobs": [
|
|
6
|
-
{
|
|
7
|
-
"id": "288307",
|
|
8
|
-
"title": "Job",
|
|
9
|
-
"full_title": "Job - 123456",
|
|
10
|
-
"shortcode": "4A16CF4210",
|
|
11
|
-
"code": "123456",
|
|
12
|
-
"state": "published",
|
|
13
|
-
"sample": false,
|
|
14
|
-
"department": null,
|
|
15
|
-
"department_hierarchy": [],
|
|
16
|
-
"url": "https://hb-6.workable.com/jobs/2653749",
|
|
17
|
-
"application_url": "https://hb-6.workable.com/jobs/2653749/candidates/new",
|
|
18
|
-
"shortlink": "https://apply.workable.com/j/4A16CF4210",
|
|
19
|
-
"location": {
|
|
20
|
-
"location_str": "Konecchlumí, Hradec Králové Region, Czechia",
|
|
21
|
-
"country": "Czechia",
|
|
22
|
-
"country_code": "CZ",
|
|
23
|
-
"region": "Hradec Králové Region",
|
|
24
|
-
"region_code": "Hradec Králové Region",
|
|
25
|
-
"city": "Konecchlumí",
|
|
26
|
-
"zip_code": null,
|
|
27
|
-
"telecommuting": false
|
|
28
|
-
},
|
|
29
|
-
"created_at": "2022-08-16T13:18:16Z"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"id": "28831e",
|
|
33
|
-
"title": "Jobík",
|
|
34
|
-
"full_title": "Jobík - Felton",
|
|
35
|
-
"shortcode": "AFE5476EB0",
|
|
36
|
-
"code": null,
|
|
37
|
-
"state": "published",
|
|
38
|
-
"sample": false,
|
|
39
|
-
"department": null,
|
|
40
|
-
"department_hierarchy": [],
|
|
41
|
-
"url": "https://hb-6.workable.com/jobs/2653772",
|
|
42
|
-
"application_url": "https://hb-6.workable.com/jobs/2653772/candidates/new",
|
|
43
|
-
"shortlink": "https://apply.workable.com/j/AFE5476EB0",
|
|
44
|
-
"location": {
|
|
45
|
-
"location_str": "Felton, Holguin, Cuba",
|
|
46
|
-
"country": "Cuba",
|
|
47
|
-
"country_code": "CU",
|
|
48
|
-
"region": "Holguin",
|
|
49
|
-
"region_code": "Holguin",
|
|
50
|
-
"city": "Felton",
|
|
51
|
-
"zip_code": null,
|
|
52
|
-
"telecommuting": false
|
|
53
|
-
},
|
|
54
|
-
"created_at": "2022-08-16T13:25:41Z"
|
|
55
|
-
}
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"headers": {
|
|
3
|
-
"user": "TestUser"
|
|
4
|
-
},
|
|
5
|
-
"data": [
|
|
6
|
-
{
|
|
7
|
-
"body": "{\"id\":\"288307\",\"title\":\"Job\",\"full_title\":\"Job - 123456\",\"shortcode\":\"4A16CF4210\",\"code\":\"123456\",\"state\":\"published\",\"sample\":false,\"department\":null,\"department_hierarchy\":[],\"url\":\"https://hb-6.workable.com/jobs/2653749\",\"application_url\":\"https://hb-6.workable.com/jobs/2653749/candidates/new\",\"shortlink\":\"https://apply.workable.com/j/4A16CF4210\",\"location\":{\"location_str\":\"Konecchlumí, Hradec Králové Region, Czechia\",\"country\":\"Czechia\",\"country_code\":\"CZ\",\"region\":\"Hradec Králové Region\",\"region_code\":\"Hradec Králové Region\",\"city\":\"Konecchlumí\",\"zip_code\":null,\"telecommuting\":false},\"created_at\":\"2022-08-16T13:18:16Z\"}",
|
|
8
|
-
"headers": {}
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"body": "{\"id\":\"28831e\",\"title\":\"Jobík\",\"full_title\":\"Jobík - Felton\",\"shortcode\":\"AFE5476EB0\",\"code\":null,\"state\":\"published\",\"sample\":false,\"department\":null,\"department_hierarchy\":[],\"url\":\"https://hb-6.workable.com/jobs/2653772\",\"application_url\":\"https://hb-6.workable.com/jobs/2653772/candidates/new\",\"shortlink\":\"https://apply.workable.com/j/AFE5476EB0\",\"location\":{\"location_str\":\"Felton, Holguin, Cuba\",\"country\":\"Cuba\",\"country_code\":\"CU\",\"region\":\"Holguin\",\"region_code\":\"Holguin\",\"city\":\"Felton\",\"zip_code\":null,\"telecommuting\":false},\"created_at\":\"2022-08-16T13:25:41Z\"}",
|
|
12
|
-
"headers": {}
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -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 WORKABLE_GET_ACCOUNTS_BATCH } from '../WorkableGetAccountsBatch';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for WorkableGetAccountsBatch', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testBatch(WORKABLE_GET_ACCOUNTS_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 WORKABLE_JOBS_BATCH } from '../WorkableJobsBatch';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for WorkableJobsBatch', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testBatch(WORKABLE_JOBS_BATCH);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,70 +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 { ACCESS_TOKEN } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
|
|
8
|
-
import { ABasicApplication } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
|
|
9
|
-
import RequestDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/RequestDto';
|
|
10
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
11
|
-
import AProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/AProcessDto';
|
|
12
|
-
import { CommonHeaders, JSON_TYPE } from '@orchesty/nodejs-sdk/dist/lib/Utils/Headers';
|
|
13
|
-
|
|
14
|
-
export const NAME = 'workable';
|
|
15
|
-
export const SUBDOMAIN = 'subdomain';
|
|
16
|
-
|
|
17
|
-
export default class WorkableApplication extends ABasicApplication {
|
|
18
|
-
|
|
19
|
-
public getName(): string {
|
|
20
|
-
return NAME;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public getPublicName(): string {
|
|
24
|
-
return 'Workable';
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public getDescription(): string {
|
|
28
|
-
return 'World’s leading hiring platform. Companies of all sizes and across all industries use our software to manage their in-house recruitment and hire the best talent';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public getLogo(): string {
|
|
32
|
-
return 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IlZyc3R2YV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTAwIDEwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOm5vbmU7fQoJLnN0MXtmaWxsOiMwMTAyMEY7fQo8L3N0eWxlPgo8Zz4KCTxyZWN0IHg9IjAuMSIgeT0iMjMuMiIgY2xhc3M9InN0MCIgd2lkdGg9IjY4LjMiIGhlaWdodD0iNTMuNyIvPgoJPGc+CgkJPHBhdGggY2xhc3M9InN0MSIgZD0iTTYzLjQsNTIuNWMyLjktNC41LDQuNS05LjYsNC45LTE0LjljMC4xLTQuMi0xLjctOC4yLTQuOS0xMC45Yy04LjYtNy4yLTI1LjUtMy40LTI1LjMsMTEuMQoJCQljMC4xLDUuNSwyLjcsMTIuNSw5LjYsMjEuMWMyLTEuOCwzLjYtNCw0LjctNi41Yy0xOC4zLTI0LjksMjAuMi0yNi4zLDEsMS40Yy0xLjQsMi4yLTMuMSw0LjItNSw2Yy02LDUuNi0xMS40LDcuNC0xNi4xLDYuNgoJCQljLTE2LjQtMi43LTE5LTI3LjEtMjAuMi00MS42aC0xMmMwLDAuMiwwLDAuMywwLDAuNXYyLjdjMC42LDI4LjgsMjEsNjguOSw1My42LDM3LjRjMS44LTEuOCwzLjUtMy44LDUuMS01LjgKCQkJQzYwLjUsNTcuMiw2Miw1NC45LDYzLjQsNTIuNSIvPgoJPC9nPgoJPHBhdGggZD0iTTkxLjEsMzkuOWMtMi4yLDE2LjktMTIsMzEuMi0yNi44LDIzLjRjLTAuMywwLjQtMC42LDAuOC0wLjksMS4yYy0xLjQsMS43LTMsMy4yLTQuNyw0LjVjMCwwLTAuMSwwLTAuMS0wLjEKCQljMS41LDEsMy4yLDEuOCw0LjksMi41QzgxLjYsNzguNCw5OC4zLDYxLDk5LjksMzkuMWwtOC42LTAuNEM5MS4yLDM5LjEsOTEuMSwzOS41LDkxLjEsMzkuOSIvPgo8L2c+Cjwvc3ZnPgo=';
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public getFormStack(): FormStack {
|
|
36
|
-
const form = new Form(CoreFormsEnum.AUTHORIZATION_FORM, getFormName(CoreFormsEnum.AUTHORIZATION_FORM))
|
|
37
|
-
.addField(new Field(FieldType.TEXT, ACCESS_TOKEN, 'Access Token', undefined, true))
|
|
38
|
-
.addField(new Field(FieldType.TEXT, SUBDOMAIN, 'Subdomain', 'www', true));
|
|
39
|
-
|
|
40
|
-
return new FormStack().addForm(form);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public isAuthorized(applicationInstall: ApplicationInstall): boolean {
|
|
44
|
-
const authorizationForm = applicationInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM];
|
|
45
|
-
return authorizationForm?.[ACCESS_TOKEN] && authorizationForm?.[SUBDOMAIN];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public getRequestDto(
|
|
49
|
-
dto: AProcessDto,
|
|
50
|
-
applicationInstall: ApplicationInstall,
|
|
51
|
-
method: HttpMethods,
|
|
52
|
-
uri?: string,
|
|
53
|
-
data?: unknown,
|
|
54
|
-
): RequestDto {
|
|
55
|
-
const request = new RequestDto(`https://${uri}`, method, dto);
|
|
56
|
-
const accessToken = applicationInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM][ACCESS_TOKEN];
|
|
57
|
-
request.setHeaders({
|
|
58
|
-
[CommonHeaders.CONTENT_TYPE]: JSON_TYPE,
|
|
59
|
-
[CommonHeaders.ACCEPT]: JSON_TYPE,
|
|
60
|
-
[CommonHeaders.AUTHORIZATION]: `Bearer ${accessToken}`,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
if (data) {
|
|
64
|
-
request.setJsonBody(data);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return request;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
package/test/dataProvider.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { appInstall, DEFAULT_ACCESS_TOKEN, DEFAULT_USER } from '@orchesty/nodejs-connectors/test/DataProvider';
|
|
2
|
-
import {
|
|
3
|
-
container, db, sender,
|
|
4
|
-
} from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
5
|
-
import CoreFormsEnum from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
|
|
6
|
-
import { ACCESS_TOKEN } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Provider/OAuth2/OAuth2Provider';
|
|
7
|
-
import WorkableGetAccountsBatch from '../src/Batch/WorkableGetAccountsBatch';
|
|
8
|
-
import WorkableJobsBatch from '../src/Batch/WorkableJobsBatch';
|
|
9
|
-
import WorkableApplication, { NAME, SUBDOMAIN } from '../src/WorkableApplication';
|
|
10
|
-
|
|
11
|
-
export default function init(): void {
|
|
12
|
-
appInstall(NAME, DEFAULT_USER, {
|
|
13
|
-
[CoreFormsEnum.AUTHORIZATION_FORM]: {
|
|
14
|
-
[ACCESS_TOKEN]: DEFAULT_ACCESS_TOKEN,
|
|
15
|
-
[SUBDOMAIN]: 'hb-6',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const app = new WorkableApplication();
|
|
20
|
-
container.setApplication(app);
|
|
21
|
-
|
|
22
|
-
const jobs = new WorkableJobsBatch();
|
|
23
|
-
const getAccounts = new WorkableGetAccountsBatch();
|
|
24
|
-
|
|
25
|
-
jobs
|
|
26
|
-
.setSender(sender)
|
|
27
|
-
.setDb(db)
|
|
28
|
-
.setApplication(app);
|
|
29
|
-
container.setBatch(jobs);
|
|
30
|
-
|
|
31
|
-
getAccounts
|
|
32
|
-
.setSender(sender)
|
|
33
|
-
.setDb(db)
|
|
34
|
-
.setApplication(app);
|
|
35
|
-
container.setBatch(getAccounts);
|
|
36
|
-
}
|