@headless-adminapp/app 1.4.16 → 1.4.17
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"uuid": "11.0.3",
|
|
39
39
|
"yup": "^1.4.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "a5a471cce4df9e87552b23e3de8c90d53e4adf43"
|
|
42
42
|
}
|
|
@@ -8,9 +8,12 @@ export declare class RestDataService implements IDataService {
|
|
|
8
8
|
protected readonly options: RestDataServiceOptions;
|
|
9
9
|
constructor(options: RestDataServiceOptions);
|
|
10
10
|
protected readonly headers: Record<string, string>;
|
|
11
|
-
|
|
11
|
+
protected getHeaders(): {
|
|
12
|
+
'content-type': string;
|
|
13
|
+
};
|
|
12
14
|
setHeader(name: string, value: string): void;
|
|
13
15
|
removeHeader(name: string): void;
|
|
16
|
+
protected handleResponseError(response: Response): Promise<void>;
|
|
14
17
|
protected execute<T = unknown, D = unknown>(data: D): Promise<T>;
|
|
15
18
|
retriveRecord<T = unknown>(logicalName: string, id: string, columns: (keyof T)[], expand?: {
|
|
16
19
|
[key in keyof T]?: string[];
|
|
@@ -33,13 +33,16 @@ class RestDataService {
|
|
|
33
33
|
removeHeader(name) {
|
|
34
34
|
delete this.headers[name];
|
|
35
35
|
}
|
|
36
|
+
handleResponseError(response) {
|
|
37
|
+
return handleResponseError(response);
|
|
38
|
+
}
|
|
36
39
|
async execute(data) {
|
|
37
40
|
const response = await fetch(this.options.endpoint, {
|
|
38
41
|
headers: this.getHeaders(),
|
|
39
42
|
method: 'POST',
|
|
40
43
|
body: JSON.stringify(data),
|
|
41
44
|
});
|
|
42
|
-
await handleResponseError(response);
|
|
45
|
+
await this.handleResponseError(response);
|
|
43
46
|
return response.json();
|
|
44
47
|
}
|
|
45
48
|
async retriveRecord(logicalName, id, columns, expand) {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { IDataService } from '@headless-adminapp/core/transport';
|
|
2
|
+
export declare function useDataService<T extends IDataService = IDataService>(): T;
|