pssdk 3.0.1-rc8 → 3.1.0-rc1
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/package.json +1 -1
- package/threadableCI.js +15 -8
- package/worker.js +2 -1
package/package.json
CHANGED
package/threadableCI.js
CHANGED
|
@@ -41,8 +41,12 @@ class TreadableCI {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
toJSON() {
|
|
44
|
+
return this.ci.toJSON();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toObject() {
|
|
44
48
|
return this.pool
|
|
45
|
-
.run({ ci: this.ci }, { name: '
|
|
49
|
+
.run({ ci: this.ci }, { name: 'toObject' });
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
toArray() {
|
|
@@ -59,6 +63,9 @@ class TreadableCI {
|
|
|
59
63
|
return this.ci.cancel();
|
|
60
64
|
}
|
|
61
65
|
|
|
66
|
+
close() {
|
|
67
|
+
return this.ci.close();
|
|
68
|
+
}
|
|
62
69
|
/*********************************/
|
|
63
70
|
/******** HELPER METHODS *********/
|
|
64
71
|
/*********************************/
|
|
@@ -73,8 +80,8 @@ class TreadableCI {
|
|
|
73
80
|
return Promise.resolve(params)
|
|
74
81
|
.then(() => this.create(params))
|
|
75
82
|
.then(() => this.save(params))
|
|
76
|
-
.then(() => this.
|
|
77
|
-
.finally(() => this.
|
|
83
|
+
.then(() => this.toObject())
|
|
84
|
+
.finally(() => this.close());
|
|
78
85
|
}
|
|
79
86
|
|
|
80
87
|
/**
|
|
@@ -87,8 +94,8 @@ class TreadableCI {
|
|
|
87
94
|
fetch(params) {
|
|
88
95
|
return Promise.resolve(params)
|
|
89
96
|
.then(() => this.get(params))
|
|
90
|
-
.then(() => this.
|
|
91
|
-
.finally(() => this.
|
|
97
|
+
.then(() => this.toObject())
|
|
98
|
+
.finally(() => this.close());
|
|
92
99
|
}
|
|
93
100
|
|
|
94
101
|
/**
|
|
@@ -102,8 +109,8 @@ class TreadableCI {
|
|
|
102
109
|
return Promise.resolve(params)
|
|
103
110
|
.then(() => this.get(params))
|
|
104
111
|
.then(() => this.save(params))
|
|
105
|
-
.then(() => this.
|
|
106
|
-
.finally(() => this.
|
|
112
|
+
.then(() => this.toObject())
|
|
113
|
+
.finally(() => this.close());
|
|
107
114
|
}
|
|
108
115
|
|
|
109
116
|
/**
|
|
@@ -117,7 +124,7 @@ class TreadableCI {
|
|
|
117
124
|
return Promise.resolve(params)
|
|
118
125
|
.then(() => this.find(params))
|
|
119
126
|
.then(() => this.toArray())
|
|
120
|
-
.finally(() => this.
|
|
127
|
+
.finally(() => this.close());
|
|
121
128
|
}
|
|
122
129
|
}
|
|
123
130
|
|
package/worker.js
CHANGED
|
@@ -5,7 +5,8 @@ module.exports = {
|
|
|
5
5
|
create: ({ ci, params }) => ci.create(params),
|
|
6
6
|
save: ({ ci, params }) => ci.save(params),
|
|
7
7
|
cancel: ({ ci }) => ci.cancel(),
|
|
8
|
-
|
|
8
|
+
close: ({ ci }) => ci.close(),
|
|
9
|
+
toObject: ({ ci }) => JSON.parse(JSON.stringify(ci.toProxyObject())),
|
|
9
10
|
toArray: ({ ci }) => JSON.parse(JSON.stringify(ci.toProxyArrayOfProxyObjects())),
|
|
10
11
|
execute: ({ ci, methodName, params }) => ci.execute(methodName, params),
|
|
11
12
|
insert: ({ ci, params }) => ci.create(params).save(params),
|