@feathersjs/rest-client 5.0.0-pre.18 → 5.0.0-pre.20
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/CHANGELOG.md +23 -0
- package/lib/axios.d.ts +2 -3
- package/lib/axios.js.map +1 -1
- package/lib/base.d.ts +9 -6
- package/lib/base.js.map +1 -1
- package/lib/fetch.d.ts +2 -3
- package/lib/fetch.js.map +1 -1
- package/lib/superagent.d.ts +2 -3
- package/lib/superagent.js.map +1 -1
- package/package.json +14 -14
- package/src/axios.ts +2 -3
- package/src/base.ts +10 -6
- package/src/fetch.ts +2 -3
- package/src/superagent.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0-pre.20](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.19...v5.0.0-pre.20) (2022-05-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **dependencies:** Lock monorepo package version numbers ([#2623](https://github.com/feathersjs/feathers/issues/2623)) ([5640c10](https://github.com/feathersjs/feathers/commit/5640c1020cc139994e695d658c08bad3494db507))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [5.0.0-pre.19](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.18...v5.0.0-pre.19) (2022-05-01)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **typescript:** Improve adapter typings ([#2605](https://github.com/feathersjs/feathers/issues/2605)) ([3b2ca0a](https://github.com/feathersjs/feathers/commit/3b2ca0a6a8e03e8390272c4d7e930b4bffdaacf5))
|
|
23
|
+
* **typescript:** Improve params and query typeability ([#2600](https://github.com/feathersjs/feathers/issues/2600)) ([df28b76](https://github.com/feathersjs/feathers/commit/df28b7619161f1df5e700326f52cca1a92dc5d28))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
# [5.0.0-pre.18](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.17...v5.0.0-pre.18) (2022-04-11)
|
|
7
30
|
|
|
8
31
|
**Note:** Version bump only for package @feathersjs/rest-client
|
package/lib/axios.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base } from './base';
|
|
1
|
+
import { Base, RestClientParams } from './base';
|
|
3
2
|
export declare class AxiosClient extends Base {
|
|
4
|
-
request(options: any, params:
|
|
3
|
+
request(options: any, params: RestClientParams): any;
|
|
5
4
|
}
|
package/lib/axios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../src/axios.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"axios.js","sourceRoot":"","sources":["../src/axios.ts"],"names":[],"mappings":";;;AAAA,iCAAgD;AAEhD,MAAa,WAAY,SAAQ,WAAI;IACnC,OAAO,CAAE,OAAY,EAAE,MAAwB;QAC7C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YAC3B,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC;gBACrB,MAAM,EAAE,kBAAkB;aAC3B,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;SAC1C,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QAEtB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;aACnC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;aAC5B,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;YACpB,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC;YAEzC,MAAM,QAAQ,YAAY,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAnBD,kCAmBC"}
|
package/lib/base.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Params, Id, Query, NullableId, ServiceInterface } from '@feathersjs/feathers';
|
|
2
|
+
export interface RestClientParams extends Params {
|
|
3
|
+
connection?: any;
|
|
4
|
+
}
|
|
2
5
|
interface RestClientSettings {
|
|
3
6
|
name: string;
|
|
4
7
|
base: string;
|
|
@@ -15,11 +18,11 @@ export declare abstract class Base<T = any, D = Partial<T>> implements ServiceIn
|
|
|
15
18
|
getQuery(query: Query): string;
|
|
16
19
|
abstract request(options: any, params: Params): any;
|
|
17
20
|
methods(this: any, ...names: string[]): any;
|
|
18
|
-
find(params?:
|
|
19
|
-
get(id: Id, params?:
|
|
20
|
-
create(body: D, params?:
|
|
21
|
-
update(id: NullableId, body: D, params?:
|
|
22
|
-
patch(id: NullableId, body: D, params?:
|
|
23
|
-
remove(id: NullableId, params?:
|
|
21
|
+
find(params?: RestClientParams): any;
|
|
22
|
+
get(id: Id, params?: RestClientParams): any;
|
|
23
|
+
create(body: D, params?: RestClientParams): any;
|
|
24
|
+
update(id: NullableId, body: D, params?: RestClientParams): any;
|
|
25
|
+
patch(id: NullableId, body: D, params?: RestClientParams): any;
|
|
26
|
+
remove(id: NullableId, params?: RestClientParams): any;
|
|
24
27
|
}
|
|
25
28
|
export {};
|
package/lib/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts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@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base } from './base';
|
|
1
|
+
import { Base, RestClientParams } from './base';
|
|
3
2
|
export declare class FetchClient extends Base {
|
|
4
|
-
request(options: any, params:
|
|
3
|
+
request(options: any, params: RestClientParams): any;
|
|
5
4
|
checkStatus(response: any): any;
|
|
6
5
|
}
|
package/lib/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,iCAAgD;AAEhD,MAAa,WAAY,SAAQ,WAAI;IACnC,OAAO,CAAE,OAAY,EAAE,MAAwB;QAC7C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QAEnE,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;YACnC,MAAM,EAAE,kBAAkB;SAC3B,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QAE/C,IAAI,OAAO,CAAC,IAAI,EAAE;YAChB,YAAY,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAClD;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC;aAC9C,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC;aACtB,IAAI,CAAC,CAAC,QAAa,EAAE,EAAE;YACtB,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;IAED,WAAW,CAAE,QAAa;QACxB,IAAI,QAAQ,CAAC,EAAE,EAAE;YACf,OAAO,QAAQ,CAAC;SACjB;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,UAAU,GAAI,eAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;YAE7D,OAAO,IAAI,UAAU,CAAC,oBAAoB,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAU,EAAE,EAAE;YACrB,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC1B,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AArCD,kCAqCC"}
|
package/lib/superagent.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base } from './base';
|
|
1
|
+
import { Base, RestClientParams } from './base';
|
|
3
2
|
export declare class SuperagentClient extends Base {
|
|
4
|
-
request(options: any, params:
|
|
3
|
+
request(options: any, params: RestClientParams): Promise<unknown>;
|
|
5
4
|
}
|
package/lib/superagent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superagent.js","sourceRoot":"","sources":["../src/superagent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"superagent.js","sourceRoot":"","sources":["../src/superagent.ts"],"names":[],"mappings":";;;AAAA,iCAAgD;AAEhD,MAAa,gBAAiB,SAAQ,WAAI;IACxC,OAAO,CAAE,OAAY,EAAE,MAAwB;QAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC;aAC5D,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;aAC/B,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC;aACjC,GAAG,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;aAC5B,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;aAC1B,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;QAEhC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAEhC,IAAI,OAAO,CAAC,IAAI,EAAE;gBAChB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;aAC/B;YAED,UAAU,CAAC,GAAG,CAAC,UAAU,KAAU,EAAE,GAAQ;gBAC3C,IAAI,KAAK,EAAE;oBACT,IAAI;wBACF,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;wBAChC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;wBACxC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;qBAC3B;oBAAC,OAAO,CAAM,EAAE,GAAE;oBAEnB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;iBACtB;gBAED,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,4CA+BC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feathersjs/rest-client",
|
|
3
3
|
"description": "REST client services for different Ajax libraries",
|
|
4
|
-
"version": "5.0.0-pre.
|
|
4
|
+
"version": "5.0.0-pre.20",
|
|
5
5
|
"homepage": "https://feathersjs.com",
|
|
6
6
|
"main": "lib/",
|
|
7
7
|
"types": "lib/",
|
|
@@ -52,28 +52,28 @@
|
|
|
52
52
|
"access": "public"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@feathersjs/commons": "^5.0.0-pre.
|
|
56
|
-
"@feathersjs/errors": "^5.0.0-pre.
|
|
55
|
+
"@feathersjs/commons": "^5.0.0-pre.20",
|
|
56
|
+
"@feathersjs/errors": "^5.0.0-pre.20",
|
|
57
57
|
"@types/node-fetch": "^3.0.2",
|
|
58
58
|
"@types/superagent": "^4.1.15",
|
|
59
59
|
"qs": "^6.10.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@feathersjs/express": "^5.0.0-pre.
|
|
63
|
-
"@feathersjs/feathers": "^5.0.0-pre.
|
|
64
|
-
"@feathersjs/memory": "^5.0.0-pre.
|
|
65
|
-
"@feathersjs/tests": "^5.0.0-pre.
|
|
66
|
-
"@types/mocha": "^9.1.
|
|
67
|
-
"@types/node": "^17.0.
|
|
62
|
+
"@feathersjs/express": "^5.0.0-pre.20",
|
|
63
|
+
"@feathersjs/feathers": "^5.0.0-pre.20",
|
|
64
|
+
"@feathersjs/memory": "^5.0.0-pre.20",
|
|
65
|
+
"@feathersjs/tests": "^5.0.0-pre.20",
|
|
66
|
+
"@types/mocha": "^9.1.1",
|
|
67
|
+
"@types/node": "^17.0.31",
|
|
68
68
|
"@types/qs": "^6.9.7",
|
|
69
|
-
"axios": "^0.
|
|
70
|
-
"mocha": "^
|
|
69
|
+
"axios": "^0.27.2",
|
|
70
|
+
"mocha": "^10.0.0",
|
|
71
71
|
"node-fetch": "^2.6.1",
|
|
72
72
|
"rxjs": "^7.5.5",
|
|
73
73
|
"shx": "^0.3.4",
|
|
74
|
-
"superagent": "^7.1.
|
|
74
|
+
"superagent": "^7.1.3",
|
|
75
75
|
"ts-node": "^10.7.0",
|
|
76
|
-
"typescript": "^4.6.
|
|
76
|
+
"typescript": "^4.6.4"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "54de749a0b392c7da726c668002b50cafaca530c"
|
|
79
79
|
}
|
package/src/axios.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base } from './base';
|
|
1
|
+
import { Base, RestClientParams } from './base';
|
|
3
2
|
|
|
4
3
|
export class AxiosClient extends Base {
|
|
5
|
-
request (options: any, params:
|
|
4
|
+
request (options: any, params: RestClientParams) {
|
|
6
5
|
const config = Object.assign({
|
|
7
6
|
url: options.url,
|
|
8
7
|
method: options.method,
|
package/src/base.ts
CHANGED
|
@@ -11,6 +11,10 @@ function toError (error: Error & { code: string }) {
|
|
|
11
11
|
throw convert(error);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export interface RestClientParams extends Params {
|
|
15
|
+
connection?: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
interface RestClientSettings {
|
|
15
19
|
name: string;
|
|
16
20
|
base: string;
|
|
@@ -73,7 +77,7 @@ export abstract class Base<T = any, D = Partial<T>> implements ServiceInterface<
|
|
|
73
77
|
return this;
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
find (params:
|
|
80
|
+
find (params: RestClientParams = {}) {
|
|
77
81
|
return this.request({
|
|
78
82
|
url: this.makeUrl(params.query),
|
|
79
83
|
method: 'GET',
|
|
@@ -81,7 +85,7 @@ export abstract class Base<T = any, D = Partial<T>> implements ServiceInterface<
|
|
|
81
85
|
}, params).catch(toError);
|
|
82
86
|
}
|
|
83
87
|
|
|
84
|
-
get (id: Id, params:
|
|
88
|
+
get (id: Id, params: RestClientParams = {}) {
|
|
85
89
|
if (typeof id === 'undefined') {
|
|
86
90
|
return Promise.reject(new Error('id for \'get\' can not be undefined'));
|
|
87
91
|
}
|
|
@@ -93,7 +97,7 @@ export abstract class Base<T = any, D = Partial<T>> implements ServiceInterface<
|
|
|
93
97
|
}, params).catch(toError);
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
create (body: D, params:
|
|
100
|
+
create (body: D, params: RestClientParams = {}) {
|
|
97
101
|
return this.request({
|
|
98
102
|
url: this.makeUrl(params.query),
|
|
99
103
|
body,
|
|
@@ -102,7 +106,7 @@ export abstract class Base<T = any, D = Partial<T>> implements ServiceInterface<
|
|
|
102
106
|
}, params).catch(toError);
|
|
103
107
|
}
|
|
104
108
|
|
|
105
|
-
update (id: NullableId, body: D, params:
|
|
109
|
+
update (id: NullableId, body: D, params: RestClientParams = {}) {
|
|
106
110
|
if (typeof id === 'undefined') {
|
|
107
111
|
return Promise.reject(new Error('id for \'update\' can not be undefined, only \'null\' when updating multiple entries'));
|
|
108
112
|
}
|
|
@@ -115,7 +119,7 @@ export abstract class Base<T = any, D = Partial<T>> implements ServiceInterface<
|
|
|
115
119
|
}, params).catch(toError);
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
patch (id: NullableId, body: D, params:
|
|
122
|
+
patch (id: NullableId, body: D, params: RestClientParams = {}) {
|
|
119
123
|
if (typeof id === 'undefined') {
|
|
120
124
|
return Promise.reject(new Error('id for \'patch\' can not be undefined, only \'null\' when updating multiple entries'));
|
|
121
125
|
}
|
|
@@ -128,7 +132,7 @@ export abstract class Base<T = any, D = Partial<T>> implements ServiceInterface<
|
|
|
128
132
|
}, params).catch(toError);
|
|
129
133
|
}
|
|
130
134
|
|
|
131
|
-
remove (id: NullableId, params:
|
|
135
|
+
remove (id: NullableId, params: RestClientParams = {}) {
|
|
132
136
|
if (typeof id === 'undefined') {
|
|
133
137
|
return Promise.reject(new Error('id for \'remove\' can not be undefined, only \'null\' when removing multiple entries'));
|
|
134
138
|
}
|
package/src/fetch.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Params } from '@feathersjs/feathers';
|
|
2
1
|
import { errors } from '@feathersjs/errors';
|
|
3
|
-
import { Base } from './base';
|
|
2
|
+
import { Base, RestClientParams } from './base';
|
|
4
3
|
|
|
5
4
|
export class FetchClient extends Base {
|
|
6
|
-
request (options: any, params:
|
|
5
|
+
request (options: any, params: RestClientParams) {
|
|
7
6
|
const fetchOptions = Object.assign({}, options, params.connection);
|
|
8
7
|
|
|
9
8
|
fetchOptions.headers = Object.assign({
|
package/src/superagent.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base } from './base';
|
|
1
|
+
import { Base, RestClientParams } from './base';
|
|
3
2
|
|
|
4
3
|
export class SuperagentClient extends Base {
|
|
5
|
-
request (options: any, params:
|
|
4
|
+
request (options: any, params: RestClientParams) {
|
|
6
5
|
const superagent = this.connection(options.method, options.url)
|
|
7
6
|
.set(this.options.headers || {})
|
|
8
7
|
.set('Accept', 'application/json')
|