mdt-client 31.3.6 → 31.3.7
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/types/helpers/types.d.ts +8 -0
- package/types/services/api/ApiAccessor/apiV1Types.d.ts +1 -1
- package/types/services/api/ApiAccessorRequestAdapter/message/apiV2MessageTypes.d.ts +2 -0
- package/types/services/api/BaseQuery.d.ts +7 -0
- package/types/services/api/Query.d.ts +4 -4
- package/types/services/customModules/facades/utils/IApiFacade.d.ts +19 -1
- package/types/views/page/PageZoneTypes.d.ts +1 -1
package/package.json
CHANGED
package/types/helpers/types.d.ts
CHANGED
|
@@ -73,4 +73,12 @@ export declare type JSONString = string;
|
|
|
73
73
|
export declare type JavaScriptCodeContent = string;
|
|
74
74
|
export declare type DateString = string;
|
|
75
75
|
export declare type RequestMethod = "POST" | "GET" | string;
|
|
76
|
+
export declare enum BrandIcon {
|
|
77
|
+
primary = 0,
|
|
78
|
+
fatal = "skull",
|
|
79
|
+
danger = "hexagon-xmark",
|
|
80
|
+
warning = "triangle-exclamation",
|
|
81
|
+
success = "circle-check",
|
|
82
|
+
info = "circle-info"
|
|
83
|
+
}
|
|
76
84
|
export {};
|
|
@@ -12,5 +12,12 @@ export interface BaseQuery {
|
|
|
12
12
|
/** Сортировка записей */
|
|
13
13
|
sorting?: QuerySorting[];
|
|
14
14
|
count?: boolean;
|
|
15
|
+
/** Параметры для функции.
|
|
16
|
+
* Задаются в виде объекта, где ключ - название параметра функции, значение - значение параметра функции.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* { "search": "Some value" }
|
|
20
|
+
*/
|
|
21
|
+
functionParams?: Record<string, any>;
|
|
15
22
|
}
|
|
16
23
|
export declare type QuerySelect = string[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { Table } from "../../common/Table";
|
|
1
2
|
import { Grouping } from "../../common/list/group/groupTypes";
|
|
2
3
|
import { HierarchyQuery } from "../../common/list/hierarchy/hierarchyTypes";
|
|
3
|
-
import { Table } from "../../common/Table";
|
|
4
|
-
import { BaseQuery } from "./BaseQuery";
|
|
5
4
|
import { ApiV1 } from "./ApiAccessor/apiV1Types";
|
|
6
|
-
import { PlaceInQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/placeIn/placeInQueryTypes";
|
|
7
|
-
import { HierarchyQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
|
|
8
5
|
import { ApiV2 } from "./ApiAccessor/apiV2Types";
|
|
6
|
+
import { HierarchyQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
|
|
7
|
+
import { PlaceInQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/placeIn/placeInQueryTypes";
|
|
8
|
+
import { BaseQuery } from "./BaseQuery";
|
|
9
9
|
export interface Query extends BaseQuery {
|
|
10
10
|
options?: QueryOptions;
|
|
11
11
|
withCount?: boolean;
|
|
@@ -3,6 +3,7 @@ import { FetchResult } from "../../../../datasources/FetchResult";
|
|
|
3
3
|
import { ApiRequestOptions } from "../../../../services/api/ApiRequestOptions";
|
|
4
4
|
import { RecordId } from "../../../../common/Record";
|
|
5
5
|
import { AnyObject } from "mdtScripts/helpers/types";
|
|
6
|
+
import { MessageMetaData } from "mdtServices/api/ApiAccessorRequestAdapter/message/apiV2MessageTypes";
|
|
6
7
|
export interface QueryParams {
|
|
7
8
|
[param: string]: string | number;
|
|
8
9
|
}
|
|
@@ -26,12 +27,26 @@ export interface IApiFacade {
|
|
|
26
27
|
/** Отправить запрос к хранимой процедуре */
|
|
27
28
|
executeStoredProcedure<Result = any>(objectCode: string, params: any): PromiseLike<Result>;
|
|
28
29
|
/** Сохранить новые данные */
|
|
29
|
-
save<S = MdtQueryResult>(objectCode: string, record: MdtRecord): Promise<S>;
|
|
30
|
+
save<S = MdtQueryResult>(objectCode: string, record: MdtRecord, options?: ApiSaveOptions): Promise<S>;
|
|
30
31
|
/** Удалить данные */
|
|
31
32
|
delete(objectCode: string, ids: number[]): Promise<MdtQueryResult>;
|
|
32
33
|
/** Отправить запрос к API */
|
|
33
34
|
request<R = any>(serviceUrl: string, params?: any, options?: ApiRequestOptions): Promise<R>;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated, т.к. не поддерживает относительные пути. Используйте getApiEndpoint
|
|
37
|
+
*/
|
|
34
38
|
getFullUrl(url: string, queryParams?: QueryParams): string;
|
|
39
|
+
/** Получить полный url
|
|
40
|
+
* - поддерживает относительные пути
|
|
41
|
+
* - url можно указывать любым способом
|
|
42
|
+
*
|
|
43
|
+
* **Например,**
|
|
44
|
+
|
|
45
|
+
* Если `url` = `/item/list`, то возвращает `http://mdt-instance.ru/project/api/v1/item/list`
|
|
46
|
+
*/
|
|
47
|
+
getApiEndpoint(url: string, queryParams?: QueryParams): string;
|
|
48
|
+
/** Скачивание файла */
|
|
49
|
+
downloadFile(fileUid: string): void;
|
|
35
50
|
}
|
|
36
51
|
export interface MdtRecord {
|
|
37
52
|
$id?: RecordId;
|
|
@@ -52,3 +67,6 @@ export interface MdtQueryResult {
|
|
|
52
67
|
}[];
|
|
53
68
|
type: string;
|
|
54
69
|
}
|
|
70
|
+
export interface ApiSaveOptions {
|
|
71
|
+
messageAction: Required<Pick<MessageMetaData, "action">>;
|
|
72
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PageZoneCodes: readonly ["nav.left", "nav.right"];
|
|
1
|
+
export declare const PageZoneCodes: readonly ["top.left", "nav.left", "nav.right"];
|