pssdk 3.0.0-alpha.0 → 3.0.0-alpha.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.
Files changed (3) hide show
  1. package/appServer.js +37 -0
  2. package/index.js +4 -35
  3. package/package.json +1 -1
package/appServer.js ADDED
@@ -0,0 +1,37 @@
1
+ // eslint-disable-next-line no-undef
2
+ const JavaAppServer = Java.type('edu.apu.pssdk.AppServer');
3
+ const Piscina = require('piscina');
4
+ const path = require('path');
5
+ const ThreadableCI = require('./threadableCI.js');
6
+
7
+ class AppServer {
8
+ constructor(_appServerConfig, _logger = console) {
9
+ this.appServer = new JavaAppServer(_appServerConfig);
10
+ this.logger = _logger;
11
+ this.pool = new Piscina({
12
+ filename: path.resolve(__dirname, 'worker.js'),
13
+ idleTimeout: 60000,
14
+ });
15
+ }
16
+
17
+ ci(ciName, opts = {}) {
18
+ return new ThreadableCI(
19
+ this.appServer.ciFactory(ciName, opts),
20
+ this.pool,
21
+ );
22
+ }
23
+
24
+ ping() {
25
+ return this.ci('APU_APPLICATION_UPDATE')
26
+ .get({
27
+ ADM_APPL_NBR: '00275505',
28
+ EMPLID: '001610517',
29
+ ACAD_CAREER: 'GR',
30
+ INSTITUTION: 'APU',
31
+ })
32
+ .then(() => 'pong');
33
+ }
34
+ }
35
+
36
+ module.exports = AppServer;
37
+
package/index.js CHANGED
@@ -1,36 +1,5 @@
1
- // eslint-disable-next-line no-undef
2
- const AppServer = Java.type('edu.apu.pssdk.AppServer');
3
- const Piscina = require('piscina');
4
- const path = require('path');
5
- const ThreadableCI = require('./threadableCI.js');
1
+ const AppServer = require('./appServer.js');
6
2
 
7
- class Peoplesoft {
8
- constructor(_appServerConfig, _logger = console) {
9
- this.appServer = new AppServer(_appServerConfig);
10
- this.logger = _logger;
11
- this.pool = new Piscina({
12
- filename: path.resolve(__dirname, 'worker.js'),
13
- idleTimeout: 60000,
14
- });
15
- }
16
-
17
- ci(ciName, opts = {}) {
18
- return new ThreadableCI(
19
- this.appServer.ciFactory(ciName, opts),
20
- this.pool,
21
- );
22
- }
23
-
24
- ping() {
25
- return this.ci('APU_APPLICATION_UPDATE')
26
- .get({
27
- ADM_APPL_NBR: '00275505',
28
- EMPLID: '001610517',
29
- ACAD_CAREER: 'GR',
30
- INSTITUTION: 'APU',
31
- })
32
- .then(() => 'pong');
33
- }
34
- }
35
-
36
- module.exports = Peoplesoft;
3
+ module.exports = {
4
+ AppServer,
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pssdk",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "description": "PSSDK to Integrate with Peoplesoft Component Interfaces via GraalNodeJs",
5
5
  "keywords": [
6
6
  "pssdk",