pssdk 3.0.0-alpha.1 → 3.0.0-alpha.2

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/appServer.js CHANGED
@@ -21,17 +21,6 @@ class AppServer {
21
21
  );
22
22
  }
23
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
24
  }
35
25
 
36
26
  module.exports = AppServer;
37
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pssdk",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.2",
4
4
  "description": "PSSDK to Integrate with Peoplesoft Component Interfaces via GraalNodeJs",
5
5
  "keywords": [
6
6
  "pssdk",
package/threadableCI.js CHANGED
@@ -50,15 +50,74 @@ class TreadableCI {
50
50
  return this.ci.toJSON();
51
51
  }
52
52
 
53
+ toArray() {
54
+ return this.ci.toList();
55
+ }
56
+
53
57
  setInteractiveMode(params) {
54
58
  this.ci.setInteractiveMode(params);
55
59
  return this;
56
60
  }
57
61
 
58
- insert(params) {
59
- return this.pool
60
- .run({ ci: this.ci, params }, { name: 'insert' })
61
- .then(() => this.toJSON());
62
+ /*********************************/
63
+ /******** HELPER METHODS *********/
64
+ /*********************************/
65
+ /**
66
+ * Helper method to create and then save a new object.
67
+ *
68
+ * @param data The data for the new object.
69
+ * @return a resulting object that could be JSON stringified.
70
+ * @throws PssdkException If a PSDK specific error occurs.
71
+ */
72
+ add(params) {
73
+ return Promise.resolve(params)
74
+ .then(() => this.create(params))
75
+ .then(() => this.save(params))
76
+ .then(() => this.toJSON())
77
+ .finally(() => this.cancel());
78
+ }
79
+
80
+ /**
81
+ * Helper method to get a new object and return its data.
82
+ *
83
+ * @param data an object containing the GET keys/values.
84
+ * @return a resulting object that could be JSON stringified.
85
+ * @throws PssdkException If a PSDK specific error occurs.
86
+ */
87
+ fetch(params) {
88
+ return Promise.resolve(params)
89
+ .then(() => this.get(params))
90
+ .then(() => this.toJSON())
91
+ .finally(() => this.cancel());
92
+ }
93
+
94
+ /**
95
+ * Helper method to get and then save an object.
96
+ *
97
+ * @param The data for the object to update.
98
+ * @return a resulting object that could be JSON stringified.
99
+ * @throws PssdkException If a PSDK specific error occurs.
100
+ */
101
+ update(params) {
102
+ return Promise.resolve(params)
103
+ .then(() => this.get(params))
104
+ .then(() => this.save(params))
105
+ .then(() => this.toJSON())
106
+ .finally(() => this.cancel());
107
+ }
108
+
109
+ /**
110
+ * Helper method to do a find and return the resulting js array
111
+ *
112
+ * @param an object containing the FIND keys/values.
113
+ * @return a resulting array that could be JSON stringified.
114
+ * @throws PssdkException If a PSDK specific error occurs.
115
+ */
116
+ search(params) {
117
+ return Promise.resolve(params)
118
+ .then(() => this.find(params))
119
+ .then(() => this.toArray())
120
+ .finally(() => this.cancel());
62
121
  }
63
122
  }
64
123