@jetbrains/ring-ui 5.0.103 → 5.0.104
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/components/http/http.d.ts +6 -6
- package/components/http/http.js +12 -0
- package/dist/http/http.d.ts +6 -6
- package/dist/http/http.js +5 -0
- package/package.json +7 -7
|
@@ -40,12 +40,12 @@ export default class HTTP implements Partial<HTTPAuth> {
|
|
|
40
40
|
private _storeRequestMeta;
|
|
41
41
|
private _processResponse;
|
|
42
42
|
private static _isErrorStatus;
|
|
43
|
-
fetch: (url: string, params?: FetchParams) => Promise<
|
|
43
|
+
fetch: <T = any>(url: string, params?: FetchParams) => Promise<T>;
|
|
44
44
|
authorizedFetch(...args: Parameters<HTTP['_performRequest']>): Promise<any>;
|
|
45
|
-
request: (url: string, params?: RequestParams) => Promise<
|
|
45
|
+
request: <T = any>(url: string, params?: RequestParams) => Promise<T>;
|
|
46
46
|
getMetaForResponse: (response: object) => Partial<Response> | undefined;
|
|
47
|
-
get: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
48
|
-
post: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
49
|
-
delete: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
50
|
-
put: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
47
|
+
get: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
48
|
+
post: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
49
|
+
delete: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
50
|
+
put: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
51
51
|
}
|
package/components/http/http.js
CHANGED
|
@@ -123,6 +123,8 @@ export default class HTTP {
|
|
|
123
123
|
static _isErrorStatus(status) {
|
|
124
124
|
return status < STATUS_OK_IF_MORE_THAN || status >= STATUS_BAD_IF_MORE_THAN;
|
|
125
125
|
}
|
|
126
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
128
|
fetch = async (url, params = {}) => {
|
|
127
129
|
const { body, query = {}, ...fetchConfig } = params;
|
|
128
130
|
const response = await this._fetch(this._makeRequestUrl(url, query), {
|
|
@@ -136,6 +138,8 @@ export default class HTTP {
|
|
|
136
138
|
const response = await this._performRequest(...args);
|
|
137
139
|
return this._processResponse(response);
|
|
138
140
|
}
|
|
141
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
139
143
|
request = async (url, params) => {
|
|
140
144
|
let token = await this.requestToken?.();
|
|
141
145
|
let response = await this._performRequest(url, token, params);
|
|
@@ -159,18 +163,26 @@ export default class HTTP {
|
|
|
159
163
|
}
|
|
160
164
|
};
|
|
161
165
|
getMetaForResponse = (response) => this._requestsMeta.get(response);
|
|
166
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
162
168
|
get = (url, params) => (this.request(url, {
|
|
163
169
|
...params,
|
|
164
170
|
method: 'GET'
|
|
165
171
|
}));
|
|
172
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
173
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
174
|
post = (url, params) => (this.request(url, {
|
|
167
175
|
...params,
|
|
168
176
|
method: 'POST'
|
|
169
177
|
}));
|
|
178
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
170
180
|
delete = (url, params) => (this.request(url, {
|
|
171
181
|
...params,
|
|
172
182
|
method: 'DELETE'
|
|
173
183
|
}));
|
|
184
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
186
|
put = (url, params) => (this.request(url, {
|
|
175
187
|
...params,
|
|
176
188
|
method: 'PUT'
|
package/dist/http/http.d.ts
CHANGED
|
@@ -40,12 +40,12 @@ export default class HTTP implements Partial<HTTPAuth> {
|
|
|
40
40
|
private _storeRequestMeta;
|
|
41
41
|
private _processResponse;
|
|
42
42
|
private static _isErrorStatus;
|
|
43
|
-
fetch: (url: string, params?: FetchParams) => Promise<
|
|
43
|
+
fetch: <T = any>(url: string, params?: FetchParams) => Promise<T>;
|
|
44
44
|
authorizedFetch(...args: Parameters<HTTP['_performRequest']>): Promise<any>;
|
|
45
|
-
request: (url: string, params?: RequestParams) => Promise<
|
|
45
|
+
request: <T = any>(url: string, params?: RequestParams) => Promise<T>;
|
|
46
46
|
getMetaForResponse: (response: object) => Partial<Response> | undefined;
|
|
47
|
-
get: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
48
|
-
post: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
49
|
-
delete: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
50
|
-
put: (url: string, params?: RequestParamsWithoutMethod) => Promise<
|
|
47
|
+
get: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
48
|
+
post: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
49
|
+
delete: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
50
|
+
put: <T = any>(url: string, params?: RequestParamsWithoutMethod) => Promise<T>;
|
|
51
51
|
}
|
package/dist/http/http.js
CHANGED
|
@@ -203,10 +203,15 @@ class HTTP {
|
|
|
203
203
|
static _isErrorStatus(status) {
|
|
204
204
|
return status < STATUS_OK_IF_MORE_THAN || status >= STATUS_BAD_IF_MORE_THAN;
|
|
205
205
|
}
|
|
206
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
207
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
208
|
+
|
|
206
209
|
async authorizedFetch() {
|
|
207
210
|
const response = await this._performRequest(...arguments);
|
|
208
211
|
return this._processResponse(response);
|
|
209
212
|
}
|
|
213
|
+
// TODO: Replace any to never/unknown in next release and remove eslint-disable
|
|
214
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
export { CODE, HTTPError, HTTP as default, defaultFetchConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.104",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": "JetBrains",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -84,19 +84,19 @@
|
|
|
84
84
|
"@rollup/plugin-replace": "^5.0.2",
|
|
85
85
|
"@storybook/addon-a11y": "6.5.16",
|
|
86
86
|
"@storybook/addon-docs": "6.5.16",
|
|
87
|
-
"@storybook/addon-essentials": "6.5.
|
|
87
|
+
"@storybook/addon-essentials": "6.5.16",
|
|
88
88
|
"@storybook/addon-storyshots": "6.5.16",
|
|
89
89
|
"@storybook/addon-storyshots-puppeteer": "6.5.16",
|
|
90
90
|
"@storybook/addon-storysource": "6.5.16",
|
|
91
91
|
"@storybook/addons": "6.5.16",
|
|
92
92
|
"@storybook/builder-webpack5": "6.5.16",
|
|
93
|
-
"@storybook/client-api": "6.5.
|
|
93
|
+
"@storybook/client-api": "6.5.16",
|
|
94
94
|
"@storybook/core": "6.5.16",
|
|
95
95
|
"@storybook/html": "6.5.16",
|
|
96
|
-
"@storybook/manager-webpack5": "6.5.
|
|
96
|
+
"@storybook/manager-webpack5": "6.5.16",
|
|
97
97
|
"@storybook/react": "6.5.16",
|
|
98
98
|
"@storybook/source-loader": "6.5.16",
|
|
99
|
-
"@storybook/theming": "6.5.
|
|
99
|
+
"@storybook/theming": "6.5.16",
|
|
100
100
|
"@testing-library/react": "^13.4.0",
|
|
101
101
|
"@testing-library/user-event": "^14.4.3",
|
|
102
102
|
"@types/chai": "^4.3.4",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"core-js": "^3.27.2",
|
|
126
126
|
"cpy-cli": "^3.1.1",
|
|
127
127
|
"enzyme": "^3.11.0",
|
|
128
|
-
"eslint": "^8.
|
|
128
|
+
"eslint": "^8.33.0",
|
|
129
129
|
"eslint-import-resolver-webpack": "^0.13.2",
|
|
130
130
|
"eslint-plugin-angular": "^4.1.0",
|
|
131
131
|
"eslint-plugin-bdd": "^2.1.1",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"react-test-renderer": "^18.2.0",
|
|
159
159
|
"regenerator-runtime": "^0.13.11",
|
|
160
160
|
"rimraf": "^4.1.2",
|
|
161
|
-
"rollup": "^3.
|
|
161
|
+
"rollup": "^3.12.0",
|
|
162
162
|
"rollup-plugin-clear": "^2.0.7",
|
|
163
163
|
"rollup-plugin-styles": "^4.0.0",
|
|
164
164
|
"sinon": "^15.0.1",
|