laravel-request 1.1.15 → 1.1.16
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/src/ApiRequest.js +15 -0
- package/src/Builder.js +8 -8
package/package.json
CHANGED
package/src/ApiRequest.js
CHANGED
|
@@ -146,6 +146,21 @@ export default class ApiRequest {
|
|
|
146
146
|
return this.call(successCallback, errorCallback);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
* @param fields
|
|
152
|
+
* @param successCallback
|
|
153
|
+
* @param errorCallback
|
|
154
|
+
* @return {ApiRequest}
|
|
155
|
+
*/
|
|
156
|
+
pluck(fields, successCallback = (r) => {
|
|
157
|
+
}, errorCallback = () => {
|
|
158
|
+
}) {
|
|
159
|
+
this.data['paginateType'] = 'pluck';
|
|
160
|
+
this.data['fields'] = fields;
|
|
161
|
+
return this.call(successCallback, errorCallback);
|
|
162
|
+
}
|
|
163
|
+
|
|
149
164
|
getUrl()
|
|
150
165
|
{
|
|
151
166
|
return this.domain + '/api/v1/call/' + this.target + '/' + this.focus;
|
package/src/Builder.js
CHANGED
|
@@ -3,28 +3,32 @@ export default class Builder {
|
|
|
3
3
|
static availableMethod = [
|
|
4
4
|
'select',
|
|
5
5
|
'where',
|
|
6
|
+
'orWhere',
|
|
6
7
|
'whereDate',
|
|
8
|
+
'orWhereDate',
|
|
7
9
|
'whereYear',
|
|
10
|
+
'orWhereYear',
|
|
8
11
|
'whereMonth',
|
|
12
|
+
'orWhereMonth',
|
|
9
13
|
'has',
|
|
10
14
|
'whereIn',
|
|
15
|
+
'orWhereIn',
|
|
11
16
|
'whereNotIn',
|
|
17
|
+
'orWhereNotIn',
|
|
12
18
|
'whereHas',
|
|
13
19
|
'orWhereHas',
|
|
14
20
|
'whereHasMorph',
|
|
15
21
|
'orWhereHasMorph',
|
|
16
22
|
'whereDoesntHave',
|
|
17
23
|
'orWhereDoesntHave',
|
|
18
|
-
|
|
24
|
+
|
|
19
25
|
'orderBy',
|
|
20
26
|
'groupBy',
|
|
21
27
|
'whereNull',
|
|
22
28
|
'orWhereNull',
|
|
23
29
|
'whereNotNull',
|
|
24
30
|
'orWhereNotNull',
|
|
25
|
-
|
|
26
|
-
*@property Builder.availableMethod.with array
|
|
27
|
-
*/
|
|
31
|
+
|
|
28
32
|
'with',
|
|
29
33
|
'withCount',
|
|
30
34
|
'offset',
|
|
@@ -32,10 +36,6 @@ export default class Builder {
|
|
|
32
36
|
'distinct',
|
|
33
37
|
'owner',
|
|
34
38
|
'whereAbs',
|
|
35
|
-
|
|
36
|
-
'whereDate',
|
|
37
|
-
'whereYear',
|
|
38
|
-
'whereMonth',
|
|
39
39
|
];
|
|
40
40
|
|
|
41
41
|
constructor() {
|