mdt-client 31.3.19 → 31.3.21

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.
Files changed (131) hide show
  1. package/dist/index.d.ts +10 -11
  2. package/dist/index.js +16 -16
  3. package/package.json +29 -29
  4. package/readme.md +15 -15
  5. package/types/common/Datasource.d.ts +9 -9
  6. package/types/common/Field.d.ts +51 -51
  7. package/types/common/FieldSettings.schema.d.ts +8 -8
  8. package/types/common/MdtField.d.ts +9 -9
  9. package/types/common/MdtObject.d.ts +7 -7
  10. package/types/common/Record.d.ts +27 -27
  11. package/types/common/Table.d.ts +66 -66
  12. package/types/common/list/group/groupTypes.d.ts +30 -30
  13. package/types/common/list/hierarchy/hierarchyTypes.d.ts +48 -48
  14. package/types/common/serverMessage/ServerMessageTypes.d.ts +17 -17
  15. package/types/components/baseFormControls/input/inputOptions.d.ts +30 -31
  16. package/types/components/baseFormControls/maskedInput/MaskFormatter.types.d.ts +2 -2
  17. package/types/components/button/baseButton/buttonOptions.d.ts +12 -12
  18. package/types/components/buttonGroup/buttonGroupOptions.d.ts +7 -7
  19. package/types/components/dropdown/menu/item/dropdownInputItemOptions.d.ts +5 -5
  20. package/types/components/dropdown/menu/item/dropdownItemWrapOptions.d.ts +19 -19
  21. package/types/components/dropdown/menuActionItem/dropdownMenuItemOptions.d.ts +32 -32
  22. package/types/components/form/fieldView/fieldViewOptions.d.ts +13 -13
  23. package/types/components/form/label/labelOptions.d.ts +22 -22
  24. package/types/components/icon/iconOptions.d.ts +21 -22
  25. package/types/components/iconButton/iconButtonOptions.d.ts +9 -10
  26. package/types/components/processPrincipalsList/ProcessPrincipalsListItem.d.ts +5 -5
  27. package/types/components/resizablePanels/panelTitle/panelTitleOptions.d.ts +16 -16
  28. package/types/components/resizablePanels/panelToolbar/panelToolbarOptions.d.ts +4 -4
  29. package/types/components/resizablePanels/resizablePanel/resizablePanelOptions.d.ts +24 -24
  30. package/types/components/resizablePanels/resizablePanelsOptions.d.ts +22 -22
  31. package/types/components/toggleablePanels/toggleablePanelsOptions.d.ts +40 -40
  32. package/types/data/active/ActivationListAdapterTypes.d.ts +6 -6
  33. package/types/datasources/FetchResult.d.ts +5 -5
  34. package/types/helpers/IUi.d.ts +2 -2
  35. package/types/helpers/deleteFromArray.d.ts +1 -1
  36. package/types/helpers/events/EventEmitter.d.ts +12 -12
  37. package/types/helpers/fireEvent.d.ts +4 -4
  38. package/types/helpers/formatOptions.d.ts +14 -14
  39. package/types/helpers/formattedText.d.ts +8 -8
  40. package/types/helpers/pipeline/ImmutableArgPipeline.d.ts +7 -7
  41. package/types/helpers/pipeline/Pipeline.d.ts +20 -20
  42. package/types/helpers/redraw.d.ts +16 -16
  43. package/types/helpers/types.d.ts +84 -85
  44. package/types/helpers/ui/elementModificators/focusableComponent.d.ts +14 -15
  45. package/types/helpers/ui/elementModificators/modificatorsTypes.d.ts +4 -4
  46. package/types/helpers/ui/keyboardUtils/getKeySymbol.d.ts +2 -2
  47. package/types/helpers/ui/keyboardUtils/keyboardUtils.d.ts +23 -23
  48. package/types/helpers/ui/keyboardUtils/osByUserAgent.d.ts +1 -1
  49. package/types/helpers/utils/classNames.d.ts +20 -20
  50. package/types/helpers/utils/keyStorage/KeyStorage.d.ts +6 -6
  51. package/types/helpers/utils/memoization/memoize.d.ts +18 -18
  52. package/types/helpers/utils/object.d.ts +4 -4
  53. package/types/helpers/utils/stringifyControlSize.d.ts +3 -3
  54. package/types/helpers/utils/valued/getValued.d.ts +18 -18
  55. package/types/helpers/zone/IZone.d.ts +7 -8
  56. package/types/security/PermissionLevel.d.ts +40 -40
  57. package/types/security/User.d.ts +19 -19
  58. package/types/services/HotkeyManager.d.ts +6 -6
  59. package/types/services/IFilter.d.ts +322 -322
  60. package/types/services/ModuleData.d.ts +9 -9
  61. package/types/services/api/ApiAccessor/apiV1Types.d.ts +266 -266
  62. package/types/services/api/ApiAccessor/apiV2Types.d.ts +583 -577
  63. package/types/services/api/ApiAccessor/binding/bindingApiTypes.d.ts +37 -0
  64. package/types/services/api/ApiAccessorRequestAdapter/handlers/fetch/helpers/count/count.d.ts +10 -10
  65. package/types/services/api/ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes.d.ts +28 -28
  66. package/types/services/api/ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/placeIn/placeInQueryTypes.d.ts +9 -9
  67. package/types/services/api/ApiAccessorRequestAdapter/handlers/messageTypes.d.ts +37 -37
  68. package/types/services/api/ApiAccessorRequestAdapter/message/apiV2MessageTypes.d.ts +2 -2
  69. package/types/services/api/ApiRequestOptions.d.ts +43 -43
  70. package/types/services/api/BaseQuery.d.ts +23 -23
  71. package/types/services/api/Query.d.ts +59 -59
  72. package/types/services/api/QuerySorting.d.ts +18 -18
  73. package/types/services/api/ServerResonseType.d.ts +2 -2
  74. package/types/services/commands/Command.d.ts +22 -22
  75. package/types/services/commands/CommandGroup.d.ts +15 -15
  76. package/types/services/commands/CommandManager.d.ts +77 -77
  77. package/types/services/customModules/facades/Form/IFieldControlFacade.d.ts +26 -26
  78. package/types/services/customModules/facades/Form/IFieldControlManagerFacade.d.ts +36 -36
  79. package/types/services/customModules/facades/Form/IFieldStateFacade.d.ts +13 -13
  80. package/types/services/customModules/facades/Form/IFormControlFacade.d.ts +133 -133
  81. package/types/services/customModules/facades/Form/IFormFacade.d.ts +101 -101
  82. package/types/services/customModules/facades/IAppFacade.d.ts +38 -38
  83. package/types/services/customModules/facades/IAuthFacade.d.ts +9 -9
  84. package/types/services/customModules/facades/ILegacyFacade.d.ts +151 -146
  85. package/types/services/customModules/facades/IMdtFacade.d.ts +81 -82
  86. package/types/services/customModules/facades/IModuleRegistryFacade.d.ts +5 -5
  87. package/types/services/customModules/facades/IPageFacade.d.ts +7 -7
  88. package/types/services/customModules/facades/List/Column/IColumnFacade.d.ts +7 -7
  89. package/types/services/customModules/facades/List/IListCellFacade.d.ts +8 -8
  90. package/types/services/customModules/facades/List/IListComponentFacade.d.ts +10 -10
  91. package/types/services/customModules/facades/List/IListControlFacade.d.ts +88 -88
  92. package/types/services/customModules/facades/List/IListRowFacade.d.ts +2 -2
  93. package/types/services/customModules/facades/List/IListServiceFacade.d.ts +53 -53
  94. package/types/services/customModules/facades/components/CodeEditorFacade.d.ts +9 -9
  95. package/types/services/customModules/facades/components/ModalFacade.d.ts +4 -4
  96. package/types/services/customModules/facades/formDashboard/IFormDashboard.d.ts +15 -15
  97. package/types/services/customModules/facades/internalModules/importFormCtrl.types.d.ts +76 -76
  98. package/types/services/customModules/facades/internalModules/importModuleFacade.d.ts +48 -48
  99. package/types/services/customModules/facades/internalModules/modulesFacadeTypes.d.ts +11 -11
  100. package/types/services/customModules/facades/internalModules/statusFacade.d.ts +13 -13
  101. package/types/services/customModules/facades/record/IRecordFacade.d.ts +13 -13
  102. package/types/services/customModules/facades/record/IRecordManagerFacade.d.ts +5 -5
  103. package/types/services/customModules/facades/schema/IFieldFacade.d.ts +11 -11
  104. package/types/services/customModules/facades/schema/IObjectFacade.d.ts +15 -15
  105. package/types/services/customModules/facades/schema/ISchemaFacade.d.ts +11 -11
  106. package/types/services/customModules/facades/services/CommandManagerFacade.d.ts +11 -11
  107. package/types/services/customModules/facades/services/IListButtonExtendPipelineService.d.ts +13 -13
  108. package/types/services/customModules/facades/services/INavigationFacade.d.ts +87 -87
  109. package/types/services/customModules/facades/services/ISecurityFacade.d.ts +13 -13
  110. package/types/services/customModules/facades/utils/IApiFacade.d.ts +91 -92
  111. package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +85 -81
  112. package/types/services/customModules/facades/utils/IUiFacade.d.ts +83 -84
  113. package/types/services/customModules/facades/utils/IUtilsFacade.d.ts +26 -26
  114. package/types/services/customModules/facades/utils/ImUtilsFacade.d.ts +25 -26
  115. package/types/services/dropdown/IDropDownMenu.d.ts +40 -41
  116. package/types/services/e2e/e2eServiceType.d.ts +11 -11
  117. package/types/views/controls/Control.d.ts +7 -7
  118. package/types/views/controls/panels/panelOptions.d.ts +15 -15
  119. package/types/views/form/controls/commonControl/ICommonControl.d.ts +28 -29
  120. package/types/views/form/controls/fileupload/FileInputFacade.types.d.ts +6 -6
  121. package/types/views/form/controls/monacoEditor/MonacoCodeOptions.schema.d.ts +23 -23
  122. package/types/views/form/controls/monacoEditor/jsonSchemas/Button.schema.d.ts +70 -70
  123. package/types/views/form/controls/picker/multiPickerFacade/IMultiPickerFacade.d.ts +36 -36
  124. package/types/views/form/controls/toggleablePanels/editor/toggleablePanelsEditorFacadeOptions.d.ts +21 -21
  125. package/types/views/form/formTypes.d.ts +4 -4
  126. package/types/views/form/schema/FormPageOptions.schema.d.ts +19 -19
  127. package/types/views/list/IListView.d.ts +70 -71
  128. package/types/views/list/schema/ListPageOptions.schema.d.ts +116 -116
  129. package/types/views/page/PageZoneTypes.d.ts +1 -1
  130. package/types/views/page/charts/ChartControlOptions.schema.d.ts +617 -569
  131. package/types/views/page/charts/facade/I/320/241hartControlFacade.d.ts +24 -23
@@ -1,577 +1,583 @@
1
- import { HierarchicalRecord, MdtRecord, RecordId } from "../../../../scripts/common/Record";
2
- import { AnyObject, ColorStyle, FieldPath, LanguageId, Markdown, ModuleId, ObjectCode, ObjectId, ObjectTitle } from "../../../../scripts/helpers/types";
3
- import { FETCH_COUNT_ALIAS } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/count/count";
4
- import { DataExtraInformation } from "../ApiAccessorRequestAdapter/handlers/messageTypes";
5
- import { ApiV1 } from "./apiV1Types";
6
- import { WithExpandedIds } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
7
- import { PermissionLevelString } from "../../../../scripts/security/PermissionLevel";
8
- import { MessageUiType, UiType } from "../../../../scripts/helpers/IUi";
9
- export declare namespace ApiV2 {
10
- namespace Request {
11
- type Common = (Save | AnyObject) & WithMessageAction;
12
- interface Save {
13
- updates: Save.Update[];
14
- exts?: Save.Extenders;
15
- params?: Save.Params;
16
- }
17
- interface WithMessageAction {
18
- messageAction?: MessageAction | MessageActionForm;
19
- }
20
- interface MessageActionForm {
21
- form: {
22
- objectCode: string;
23
- record: Record<string, unknown>;
24
- };
25
- }
26
- interface MessageAction {
27
- actions?: {
28
- code: string;
29
- value: string;
30
- }[];
31
- recordActions?: MessageRecordAction[];
32
- }
33
- interface MessageRecordAction {
34
- recordId: RecordId;
35
- code: string;
36
- value: string;
37
- }
38
- namespace Save {
39
- type UpdateType = "none" | "createNew" | "delete";
40
- interface Params {
41
- formId?: RecordId;
42
- }
43
- interface Update {
44
- record: MdtRecord;
45
- table: string;
46
- updateType: Save.UpdateType;
47
- children?: Update[];
48
- o2mFkField?: string;
49
- }
50
- interface Extenders {
51
- dataExt?: DataExt;
52
- status?: StatusExt;
53
- }
54
- interface DataExt {
55
- exts: {
56
- ID_Language_ext: RecordId;
57
- [key: string]: any;
58
- };
59
- }
60
- interface StatusExt {
61
- statusComment: string;
62
- }
63
- }
64
- /** FETCH */
65
- interface Fetch {
66
- table?: string;
67
- select?: Fetch.Select;
68
- orderBy?: Fetch.OrderBy;
69
- groupBy?: Fetch.GroupBy;
70
- filter?: Filter;
71
- skip?: number;
72
- take?: number;
73
- distinct?: boolean;
74
- exts?: Fetch.Exts;
75
- params?: Fetch.Params & Fetch.SPParams;
76
- }
77
- namespace Fetch {
78
- interface Params {
79
- dataext?: "explicit";
80
- }
81
- /** Параметры для передачи в хранимую процедуру */
82
- type SPParams = AnyObject;
83
- type Select = SelectItem[];
84
- type SelectItem = {
85
- path: string;
86
- aggregate?: Aggregation;
87
- alias?: string;
88
- castType?: CastType;
89
- };
90
- type Aggregation = {
91
- function: ApiV2.AggregationType;
92
- distinct?: boolean;
93
- };
94
- type CastType = "date";
95
- type OrderByItem = {
96
- path: string;
97
- orderType: "asc" | "desc";
98
- castType?: CastType;
99
- aggregate?: Aggregation;
100
- };
101
- type OrderBy = OrderByItem[];
102
- type GroupBy = {
103
- path: string;
104
- }[];
105
- interface Exts {
106
- dataExt?: Exts.DataExt;
107
- fatLink?: Exts.FatLink;
108
- group?: Exts.Group;
109
- hierarchy?: Exts.Hierarchy;
110
- hierarchyLegacy?: Exts.HierarchyLegacy;
111
- dependency?: Exts.Dependency;
112
- placeIn?: Exts.PlaceIn;
113
- audit?: Exts.Audit;
114
- tabular?: Exts.Tabular;
115
- tag?: Exts.Tag;
116
- workflow?: Exts.Workflow;
117
- workflowStage?: Exts.WorkflowStage;
118
- mapping?: Exts.Mapping;
119
- [k: string]: AnyObject | undefined;
120
- }
121
- namespace Exts {
122
- interface Group {
123
- groups: GroupItem[];
124
- allParents?: boolean;
125
- orphans?: boolean;
126
- toggledValues?: string[][];
127
- skippedRowsCount?: number;
128
- }
129
- interface GroupItem {
130
- path: FieldPath;
131
- collapsed?: boolean;
132
- select?: FieldPath[];
133
- sorting?: GroupItemSorting[];
134
- }
135
- interface GroupItemSorting {
136
- path: string;
137
- desc: boolean;
138
- }
139
- interface DataExt {
140
- explicit?: boolean;
141
- args?: DataExtArgs;
142
- }
143
- interface DataExtArgs {
144
- ID_Language_ext?: LanguageId;
145
- }
146
- interface FatLink {
147
- date?: string;
148
- limit?: number;
149
- }
150
- interface Hierarchy extends WithExpandedIds {
151
- idField?: string;
152
- parentIdField?: string;
153
- parentId?: RecordId;
154
- }
155
- interface HierarchyLegacy {
156
- idField?: string;
157
- parentIdField?: string;
158
- mode?: Mode;
159
- filter?: Filter;
160
- }
161
- type Mode = "NA" | "Up" | "Down" | "UpDown";
162
- type Dependency = FetchDependencyTypes.Request;
163
- type PlaceIn = {
164
- queries: {
165
- query: Fetch;
166
- name: string;
167
- fk: string;
168
- }[];
169
- };
170
- type Audit = TicketQuery;
171
- type Tag = TicketQuery;
172
- interface Tabular {
173
- select?: {
174
- path: FieldPath;
175
- table: ObjectCode;
176
- }[];
177
- groupBy?: {
178
- path: FieldPath;
179
- table: ObjectCode;
180
- }[];
181
- orderBy?: {
182
- path: FieldPath;
183
- table: ObjectCode;
184
- }[];
185
- }
186
- type Workflow = TicketQuery;
187
- interface WorkflowStage {
188
- enabled: boolean;
189
- }
190
- interface TicketQuery {
191
- ticket?: string;
192
- generateTicket?: true;
193
- }
194
- interface Mapping {
195
- flagGetMappedFKs: boolean;
196
- }
197
- }
198
- }
199
- }
200
- namespace Response {
201
- export type Main = AnyObject | Error | Save | Fetch;
202
- type BaseResponse = {
203
- exts?: Exts;
204
- };
205
- interface Exts {
206
- objectRule?: {
207
- logs: string[];
208
- };
209
- }
210
- export interface Error extends BaseResponse {
211
- message: Markdown;
212
- code: string;
213
- debug?: any;
214
- args?: any;
215
- error: boolean;
216
- }
217
- export interface Save extends BaseResponse, WithMessage {
218
- stats: Save.SaveStats;
219
- details: Save.SaveDetails;
220
- }
221
- export namespace Save {
222
- export interface SaveDetails {
223
- inserted?: SaveDetailsItem[];
224
- updated?: SaveDetailsItem[];
225
- deleted?: SaveDetailsItem[];
226
- }
227
- interface SaveDetailsItem {
228
- table: ObjectCode;
229
- ids: RecordId[];
230
- }
231
- export interface SaveStats {
232
- inserted?: number;
233
- updated?: number;
234
- delete?: number;
235
- }
236
- export {};
237
- }
238
- export interface Fetch {
239
- message?: DataExtraInformation;
240
- exts?: Fetch.Exts;
241
- rows?: Fetch.Row[];
242
- [k: string]: any;
243
- }
244
- /** Fetch */
245
- export namespace Fetch {
246
- type Row = MdtRecord & {
247
- [FETCH_COUNT_ALIAS]?: number;
248
- $exts?: RecordExt;
249
- };
250
- interface RecordExt extends RecordExt.WorkflowStageExt {
251
- required?: {
252
- fields: {
253
- [k: string]: boolean;
254
- };
255
- };
256
- placeIn?: {
257
- rows: Record<string, Fetch.Row[]>;
258
- };
259
- audit?: {
260
- ticket: string;
261
- };
262
- tag?: {
263
- tags: number[];
264
- ticket: string;
265
- };
266
- workflow?: {
267
- ticket: string;
268
- };
269
- dependency?: FetchDependencyTypes.RecordExtResponse;
270
- hierarchy?: {
271
- hasChildren: boolean;
272
- children?: Row[];
273
- };
274
- /**
275
- * Ограничения на действия (CRUD) над записью и её полями, накладываемые функцией безопасности.
276
- * [Документация](https://ics-it.gram.ax/mdt/security/objectSecurity/sqlFn?l=ru)
277
- */
278
- securityExt?: {
279
- level: PermissionLevelString;
280
- baseLevel: PermissionLevelString;
281
- fields: {
282
- [fieldId: number]: PermissionLevelString;
283
- };
284
- };
285
- }
286
- namespace RecordExt {
287
- interface WorkflowStageExt {
288
- workflowStage?: WorkflowStage;
289
- }
290
- interface WorkflowStage {
291
- title: string;
292
- icon?: string;
293
- labelStyleCode?: ColorStyle;
294
- }
295
- }
296
- interface Exts {
297
- hierarchyLegacy?: Exts.HierarchyLegacy;
298
- group?: Exts.GroupQuery;
299
- }
300
- namespace Exts {
301
- interface HierarchyLegacy {
302
- rows: HierarchicalRecord[];
303
- }
304
- interface GroupQuery {
305
- groups: OutputGroup[];
306
- skippedRowsCount?: number;
307
- }
308
- }
309
- interface OutputGroup {
310
- count: number;
311
- object?: {
312
- [k: string]: any;
313
- };
314
- value?: any;
315
- subGroups?: OutputGroup[];
316
- isEmpty?: boolean;
317
- }
318
- }
319
- export interface WithMessage {
320
- message?: Message;
321
- }
322
- export type Message = MessageWithData | MessageWithForm;
323
- export type MessageWithData = MessageBase & MessageData;
324
- export type MessageWithForm = MessageBase & MessageForm;
325
- interface MessageBase {
326
- type: Message.Type;
327
- title?: string;
328
- icon?: string;
329
- }
330
- interface MessageData {
331
- actions?: Message.Action[];
332
- data: Message.ResponseData[];
333
- }
334
- export interface MessageForm {
335
- form?: {
336
- layoutCode: string;
337
- object: {
338
- Code: string;
339
- Fields: {
340
- Code: string;
341
- Type: string;
342
- Required: string;
343
- RefTableCode: string;
344
- }[];
345
- Title?: string;
346
- Description?: string;
347
- };
348
- };
349
- }
350
- export namespace Message {
351
- type Type = MessageUiType;
352
- type UIType = UiType;
353
- interface Action {
354
- title: string;
355
- icon?: string;
356
- type: Type;
357
- paramCode: string;
358
- paramValue: string;
359
- }
360
- type ResponseData = ResponseText | ResponseRows | ResponseRef | ResponseRecordAction;
361
- interface ResponseText {
362
- type: "Text";
363
- text: string;
364
- }
365
- interface ResponseRows<T extends MdtRecord = MdtRecord> {
366
- type: "Rows";
367
- rows: T[];
368
- }
369
- interface ResponseRef {
370
- type: "Refs";
371
- idObject: number;
372
- idRecords: RecordId[];
373
- }
374
- interface ResponseRecordAction<R = any> {
375
- type: "RecordAction";
376
- columns: ResponseRecordActionColumn[];
377
- rows: ResponseRecordActionRow<R>[];
378
- }
379
- interface ResponseRecordActionColumn {
380
- code: string;
381
- title: string;
382
- }
383
- interface ResponseRecordActionRow<R = any> {
384
- recordId: RecordId;
385
- record: R;
386
- recordActions: ResponseRecordActionAction[];
387
- }
388
- interface ResponseRecordActionAction {
389
- code: string;
390
- values: {
391
- title: string;
392
- value: string;
393
- }[];
394
- }
395
- }
396
- export namespace File {
397
- export interface Upload {
398
- id: RecordId;
399
- name: string;
400
- uid: string;
401
- shortUid: string;
402
- size?: number;
403
- storageProvider?: UploadStorageProvider;
404
- }
405
- type UploadStorageProvider = ApiV1.Response.File.StorageProvider;
406
- export {};
407
- }
408
- export namespace Data {
409
- export interface Import {
410
- stats: Save.SaveStats;
411
- details: {
412
- inserted?: ImportDetail[];
413
- updated?: ImportDetail[];
414
- delete?: ImportDetail[];
415
- };
416
- }
417
- interface ImportDetail {
418
- table: string;
419
- ids: RecordId[];
420
- }
421
- export {};
422
- }
423
- export namespace Template {
424
- interface Preview {
425
- context: AnyObject;
426
- script: string;
427
- header: string;
428
- text: string;
429
- }
430
- }
431
- export namespace User {
432
- interface EntityPermission {
433
- level: PermissionLevelString;
434
- }
435
- interface Permissions {
436
- listview: User.EntityPermission;
437
- namedfilters: User.EntityPermission;
438
- tag: User.EntityPermission;
439
- object: ObjectPermissions;
440
- }
441
- interface ObjectPermissions {
442
- objects: ObjectPermissionObjects;
443
- }
444
- interface ObjectPermissionObjects {
445
- [objectCode: string]: {
446
- level: PermissionLevelString;
447
- fields?: Record<string, User.EntityPermission>;
448
- };
449
- }
450
- }
451
- export interface User {
452
- id: number;
453
- isAdmin: boolean;
454
- isAnonymous: boolean;
455
- isImpersonated: boolean;
456
- languageId: number;
457
- roles: string[];
458
- permissions?: User.Permissions;
459
- identityName?: string;
460
- languageCode?: string;
461
- login?: string;
462
- fullName?: string;
463
- email?: string;
464
- }
465
- export type Schema = Schema.Object | Schema.Object[];
466
- export namespace Schema {
467
- type Object = {
468
- $id?: ObjectId;
469
- Code?: ObjectCode;
470
- DefaultFieldCode?: any;
471
- Deleted?: boolean;
472
- Fields?: Field[];
473
- ID?: ObjectId;
474
- ID_ObjectType?: string;
475
- ID_ver_Module?: ModuleId;
476
- OBJECT_ID?: number;
477
- tag_Enabled?: boolean;
478
- Title?: ObjectTitle;
479
- "Title@"?: ObjectTitle;
480
- TitlePlural?: string;
481
- "TitlePlural@"?: string;
482
- Description?: string;
483
- Readonly?: boolean;
484
- Icon?: string;
485
- audit_Enabled?: boolean;
486
- inline_AddInRow?: boolean;
487
- inline_Enabled?: boolean;
488
- HierarchyParentField?: string;
489
- HierarchyIDField?: string;
490
- FlagHierarchy?: boolean;
491
- FlagConfiguration?: boolean;
492
- Settings: string;
493
- AccessLevel: string;
494
- Parameters?: Parameter[];
495
- } & Record<string, any>;
496
- type Field = {
497
- Code: string;
498
- Type: string;
499
- DataType: string;
500
- $id?: ObjectId;
501
- ID?: ObjectId;
502
- Title?: string;
503
- "Title@"?: string;
504
- Identity?: boolean;
505
- RefTableCode?: string;
506
- SortOreder?: number;
507
- FlagScriptDfkInline?: boolean;
508
- Primary?: boolean;
509
- Readonly?: boolean;
510
- };
511
- type Parameter = {
512
- Code: string;
513
- DataType: string;
514
- };
515
- }
516
- export {};
517
- }
518
- type AggregationType = "sum" | "avg" | "count" | "max" | "min";
519
- type Filter = Filter.Simple | Filter.List | Filter.SubQuery | Filter.Multi;
520
- namespace Filter {
521
- export type MultiOp = "and" | "or";
522
- export type BinaryOp = "eq" | "ge" | "le" | "gt" | "lt" | "ne" | "contains" | "startsWith" | "endsWith" | "fullText" | "in";
523
- export interface Multi extends WithNot {
524
- op: MultiOp;
525
- groups: Filter[];
526
- }
527
- interface WithNot {
528
- not?: boolean;
529
- }
530
- export interface Simple extends WithNot, WithCastType {
531
- op: BinaryOp;
532
- path: string;
533
- value?: any;
534
- }
535
- export interface List extends WithNot, WithCastType {
536
- op: BinaryOp;
537
- path: string;
538
- list: string[];
539
- }
540
- export interface SubQuery extends WithNot, WithCastType {
541
- op: BinaryOp;
542
- path: string;
543
- query: SubQueryExpression;
544
- }
545
- export interface SubQueryExpression {
546
- table: string;
547
- field: string;
548
- filter?: Filter;
549
- params?: {
550
- [k: string]: any;
551
- };
552
- }
553
- interface WithCastType {
554
- castType?: ApiV2.Request.Fetch.CastType;
555
- }
556
- export {};
557
- }
558
- }
559
- /**
560
- * Расширение позволяет получить информацию о ссылках на текущую запись.
561
- */
562
- declare namespace FetchDependencyTypes {
563
- /**
564
- * В запросе указывается таблица и поле, которое ссылается на текущую таблицу
565
- */
566
- type Request = {
567
- table: string;
568
- field: string;
569
- };
570
- /**
571
- * В ответе вместе с записью приходит информация есть ли ссылки на эту запись по указанным в запросе данным
572
- */
573
- type RecordExtResponse = {
574
- hasDependencies: boolean;
575
- };
576
- }
577
- export {};
1
+ import { BindingExtData, BindingRowTypes } from "./binding/bindingApiTypes";
2
+ import { MessageUiType, UiType } from "mdtScripts/helpers/IUi";
3
+ import { PermissionLevelString } from "mdtScripts/security/PermissionLevel";
4
+ import { HierarchicalRecord, MdtRecord, RecordId } from "../../../../scripts/common/Record";
5
+ import { AnyObject, ColorStyle, FieldPath, LanguageId, Markdown, ModuleId, ObjectCode, ObjectId, ObjectTitle } from "../../../../scripts/helpers/types";
6
+ import { FETCH_COUNT_ALIAS } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/count/count";
7
+ import { WithExpandedIds } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
8
+ import { DataExtraInformation } from "../ApiAccessorRequestAdapter/handlers/messageTypes";
9
+ import { ApiV1 } from "./apiV1Types";
10
+ export declare namespace ApiV2 {
11
+ namespace Request {
12
+ type Common = (Save | AnyObject) & WithMessageAction;
13
+ interface Save {
14
+ updates: Save.Update[];
15
+ exts?: Save.Extenders;
16
+ params?: Save.Params;
17
+ }
18
+ interface WithMessageAction {
19
+ messageAction?: MessageAction | MessageActionForm;
20
+ }
21
+ interface MessageActionForm {
22
+ form: {
23
+ objectCode: string;
24
+ record: Record<string, unknown>;
25
+ };
26
+ }
27
+ interface MessageAction {
28
+ actions?: {
29
+ code: string;
30
+ value: string;
31
+ }[];
32
+ recordActions?: MessageRecordAction[];
33
+ }
34
+ interface MessageRecordAction {
35
+ recordId: RecordId;
36
+ code: string;
37
+ value: string;
38
+ }
39
+ namespace Save {
40
+ type UpdateType = "none" | "createNew" | "delete";
41
+ interface Params {
42
+ formId?: RecordId;
43
+ }
44
+ interface Update {
45
+ record: MdtRecord;
46
+ table: string;
47
+ updateType: Save.UpdateType;
48
+ children?: Update[];
49
+ o2mFkField?: string;
50
+ }
51
+ interface Extenders {
52
+ dataExt?: DataExt;
53
+ status?: StatusExt;
54
+ }
55
+ interface DataExt {
56
+ exts: {
57
+ ID_Language_ext: RecordId;
58
+ [key: string]: any;
59
+ };
60
+ }
61
+ interface StatusExt {
62
+ statusComment: string;
63
+ }
64
+ }
65
+ /** FETCH */
66
+ interface Fetch {
67
+ table?: string;
68
+ select?: Fetch.Select;
69
+ orderBy?: Fetch.OrderBy;
70
+ groupBy?: Fetch.GroupBy;
71
+ filter?: Filter;
72
+ skip?: number;
73
+ take?: number;
74
+ distinct?: boolean;
75
+ exts?: Fetch.Exts;
76
+ params?: Fetch.Params & Fetch.SPParams;
77
+ }
78
+ namespace Fetch {
79
+ interface Params {
80
+ dataext?: "explicit";
81
+ }
82
+ /** Параметры для передачи в хранимую процедуру */
83
+ type SPParams = AnyObject;
84
+ type Select = SelectItem[];
85
+ type SelectItem = {
86
+ path: string;
87
+ aggregate?: Aggregation;
88
+ alias?: string;
89
+ castType?: CastType;
90
+ };
91
+ type Aggregation = {
92
+ function: ApiV2.AggregationType;
93
+ distinct?: boolean;
94
+ };
95
+ type CastType = "date";
96
+ type OrderByItem = {
97
+ path: string;
98
+ orderType: "asc" | "desc";
99
+ castType?: CastType;
100
+ aggregate?: Aggregation;
101
+ };
102
+ type OrderBy = OrderByItem[];
103
+ type GroupBy = {
104
+ path: string;
105
+ }[];
106
+ interface Exts {
107
+ dataExt?: Exts.DataExt;
108
+ fatLink?: Exts.FatLink;
109
+ group?: Exts.Group;
110
+ hierarchy?: Exts.Hierarchy;
111
+ hierarchyLegacy?: Exts.HierarchyLegacy;
112
+ dependency?: Exts.Dependency;
113
+ placeIn?: Exts.PlaceIn;
114
+ audit?: Exts.Audit;
115
+ tabular?: Exts.Tabular;
116
+ tag?: Exts.Tag;
117
+ workflow?: Exts.Workflow;
118
+ workflowStage?: Exts.WorkflowStage;
119
+ mapping?: Exts.Mapping;
120
+ binding?: Exts.Binding;
121
+ [k: string]: AnyObject | undefined;
122
+ }
123
+ namespace Exts {
124
+ interface Group {
125
+ groups: GroupItem[];
126
+ allParents?: boolean;
127
+ orphans?: boolean;
128
+ toggledValues?: string[][];
129
+ skippedRowsCount?: number;
130
+ }
131
+ interface GroupItem {
132
+ path: FieldPath;
133
+ collapsed?: boolean;
134
+ select?: FieldPath[];
135
+ sorting?: GroupItemSorting[];
136
+ }
137
+ interface GroupItemSorting {
138
+ path: string;
139
+ desc: boolean;
140
+ }
141
+ interface DataExt {
142
+ explicit?: boolean;
143
+ args?: DataExtArgs;
144
+ }
145
+ interface DataExtArgs {
146
+ ID_Language_ext?: LanguageId;
147
+ }
148
+ interface FatLink {
149
+ date?: string;
150
+ limit?: number;
151
+ }
152
+ interface Hierarchy extends WithExpandedIds {
153
+ idField?: string;
154
+ parentIdField?: string;
155
+ parentId?: RecordId;
156
+ }
157
+ interface HierarchyLegacy {
158
+ idField?: string;
159
+ parentIdField?: string;
160
+ mode?: Mode;
161
+ filter?: Filter;
162
+ }
163
+ type Mode = "NA" | "Up" | "Down" | "UpDown";
164
+ type Dependency = FetchDependencyTypes.Request;
165
+ type PlaceIn = {
166
+ queries: {
167
+ query: Fetch;
168
+ name: string;
169
+ fk: string;
170
+ }[];
171
+ };
172
+ type Audit = TicketQuery;
173
+ type Tag = TicketQuery;
174
+ interface Tabular {
175
+ select?: {
176
+ path: FieldPath;
177
+ table: ObjectCode;
178
+ }[];
179
+ groupBy?: {
180
+ path: FieldPath;
181
+ table: ObjectCode;
182
+ }[];
183
+ orderBy?: {
184
+ path: FieldPath;
185
+ table: ObjectCode;
186
+ }[];
187
+ }
188
+ type Workflow = TicketQuery;
189
+ interface WorkflowStage {
190
+ enabled: boolean;
191
+ }
192
+ interface TicketQuery {
193
+ ticket?: string;
194
+ generateTicket?: true;
195
+ }
196
+ interface Mapping {
197
+ flagGetMappedFKs: boolean;
198
+ }
199
+ type Binding = BindingExtData;
200
+ }
201
+ }
202
+ }
203
+ namespace Response {
204
+ export type Main = AnyObject | Error | Save | Fetch;
205
+ type BaseResponse = {
206
+ exts?: Exts;
207
+ };
208
+ interface Exts {
209
+ objectRule?: {
210
+ logs: string[];
211
+ };
212
+ }
213
+ export interface Error extends BaseResponse {
214
+ message: Markdown;
215
+ code: string;
216
+ debug?: any;
217
+ args?: any;
218
+ error: boolean;
219
+ }
220
+ export interface Save extends BaseResponse, WithMessage {
221
+ stats: Save.SaveStats;
222
+ details: Save.SaveDetails;
223
+ }
224
+ export namespace Save {
225
+ export interface SaveDetails {
226
+ inserted?: SaveDetailsItem[];
227
+ updated?: SaveDetailsItem[];
228
+ deleted?: SaveDetailsItem[];
229
+ }
230
+ interface SaveDetailsItem {
231
+ table: ObjectCode;
232
+ ids: RecordId[];
233
+ }
234
+ export interface SaveStats {
235
+ inserted?: number;
236
+ updated?: number;
237
+ delete?: number;
238
+ }
239
+ export {};
240
+ }
241
+ export interface Fetch {
242
+ message?: DataExtraInformation;
243
+ exts?: Fetch.Exts;
244
+ rows?: Fetch.Row[];
245
+ [k: string]: any;
246
+ }
247
+ /** Fetch */
248
+ export namespace Fetch {
249
+ type Row = MdtRecord & {
250
+ [FETCH_COUNT_ALIAS]?: number;
251
+ $exts?: RecordExt;
252
+ };
253
+ interface RecordExt extends RecordExt.WorkflowStageExt {
254
+ required?: {
255
+ fields: {
256
+ [k: string]: boolean;
257
+ };
258
+ };
259
+ placeIn?: {
260
+ rows: Record<string, Fetch.Row[]>;
261
+ };
262
+ audit?: {
263
+ ticket: string;
264
+ };
265
+ tag?: {
266
+ tags: number[];
267
+ ticket: string;
268
+ };
269
+ workflow?: {
270
+ ticket: string;
271
+ };
272
+ dependency?: FetchDependencyTypes.RecordExtResponse;
273
+ hierarchy?: {
274
+ hasChildren: boolean;
275
+ children?: Row[];
276
+ };
277
+ binding?: {
278
+ status: BindingRowTypes;
279
+ };
280
+ /**
281
+ * Ограничения на действия (CRUD) над записью и её полями, накладываемые функцией безопасности.
282
+ * [Документация](https://ics-it.gram.ax/mdt/security/objectSecurity/sqlFn?l=ru)
283
+ */
284
+ securityExt?: {
285
+ level: PermissionLevelString;
286
+ baseLevel: PermissionLevelString;
287
+ fields: {
288
+ [fieldId: number]: PermissionLevelString;
289
+ };
290
+ };
291
+ }
292
+ namespace RecordExt {
293
+ interface WorkflowStageExt {
294
+ workflowStage?: WorkflowStage;
295
+ }
296
+ interface WorkflowStage {
297
+ title: string;
298
+ icon?: string;
299
+ labelStyleCode?: ColorStyle;
300
+ }
301
+ }
302
+ interface Exts {
303
+ hierarchyLegacy?: Exts.HierarchyLegacy;
304
+ group?: Exts.GroupQuery;
305
+ }
306
+ namespace Exts {
307
+ interface HierarchyLegacy {
308
+ rows: HierarchicalRecord[];
309
+ }
310
+ interface GroupQuery {
311
+ groups: OutputGroup[];
312
+ skippedRowsCount?: number;
313
+ }
314
+ }
315
+ interface OutputGroup {
316
+ count: number;
317
+ object?: {
318
+ [k: string]: any;
319
+ };
320
+ value?: any;
321
+ subGroups?: OutputGroup[];
322
+ isEmpty?: boolean;
323
+ }
324
+ }
325
+ export interface WithMessage {
326
+ message?: Message;
327
+ }
328
+ export type Message = MessageWithData | MessageWithForm;
329
+ export type MessageWithData = MessageBase & MessageData;
330
+ export type MessageWithForm = MessageBase & MessageForm;
331
+ interface MessageBase {
332
+ type: Message.Type;
333
+ title?: string;
334
+ icon?: string;
335
+ }
336
+ interface MessageData {
337
+ actions?: Message.Action[];
338
+ data: Message.ResponseData[];
339
+ }
340
+ export interface MessageForm {
341
+ form?: {
342
+ layoutCode: string;
343
+ object: {
344
+ Code: string;
345
+ Fields: {
346
+ Code: string;
347
+ Type: string;
348
+ Required: string;
349
+ RefTableCode: string;
350
+ }[];
351
+ Title?: string;
352
+ Description?: string;
353
+ };
354
+ };
355
+ }
356
+ export namespace Message {
357
+ type Type = MessageUiType;
358
+ type UIType = UiType;
359
+ interface Action {
360
+ title: string;
361
+ icon?: string;
362
+ type: Type;
363
+ paramCode: string;
364
+ paramValue: string;
365
+ }
366
+ type ResponseData = ResponseText | ResponseRows | ResponseRef | ResponseRecordAction;
367
+ interface ResponseText {
368
+ type: "Text";
369
+ text: string;
370
+ }
371
+ interface ResponseRows<T extends MdtRecord = MdtRecord> {
372
+ type: "Rows";
373
+ rows: T[];
374
+ }
375
+ interface ResponseRef {
376
+ type: "Refs";
377
+ idObject: number;
378
+ idRecords: RecordId[];
379
+ }
380
+ interface ResponseRecordAction<R = any> {
381
+ type: "RecordAction";
382
+ columns: ResponseRecordActionColumn[];
383
+ rows: ResponseRecordActionRow<R>[];
384
+ }
385
+ interface ResponseRecordActionColumn {
386
+ code: string;
387
+ title: string;
388
+ }
389
+ interface ResponseRecordActionRow<R = any> {
390
+ recordId: RecordId;
391
+ record: R;
392
+ recordActions: ResponseRecordActionAction[];
393
+ }
394
+ interface ResponseRecordActionAction {
395
+ code: string;
396
+ values: {
397
+ title: string;
398
+ value: string;
399
+ }[];
400
+ }
401
+ }
402
+ export namespace File {
403
+ export interface Upload {
404
+ id: RecordId;
405
+ name: string;
406
+ uid: string;
407
+ shortUid: string;
408
+ size?: number;
409
+ storageProvider?: UploadStorageProvider;
410
+ }
411
+ type UploadStorageProvider = ApiV1.Response.File.StorageProvider;
412
+ export {};
413
+ }
414
+ export namespace Data {
415
+ export interface Import {
416
+ stats: Save.SaveStats;
417
+ details: {
418
+ inserted?: ImportDetail[];
419
+ updated?: ImportDetail[];
420
+ delete?: ImportDetail[];
421
+ };
422
+ }
423
+ interface ImportDetail {
424
+ table: string;
425
+ ids: RecordId[];
426
+ }
427
+ export {};
428
+ }
429
+ export namespace Template {
430
+ interface Preview {
431
+ context: AnyObject;
432
+ script: string;
433
+ header: string;
434
+ text: string;
435
+ }
436
+ }
437
+ export namespace User {
438
+ interface EntityPermission {
439
+ level: PermissionLevelString;
440
+ }
441
+ interface Permissions {
442
+ listview: User.EntityPermission;
443
+ namedfilters: User.EntityPermission;
444
+ tag: User.EntityPermission;
445
+ object: ObjectPermissions;
446
+ }
447
+ interface ObjectPermissions {
448
+ objects: ObjectPermissionObjects;
449
+ }
450
+ interface ObjectPermissionObjects {
451
+ [objectCode: string]: {
452
+ level: PermissionLevelString;
453
+ fields?: Record<string, User.EntityPermission>;
454
+ };
455
+ }
456
+ }
457
+ export interface User {
458
+ id: number;
459
+ isAdmin: boolean;
460
+ isAnonymous: boolean;
461
+ isImpersonated: boolean;
462
+ languageId: number;
463
+ roles: string[];
464
+ permissions?: User.Permissions;
465
+ identityName?: string;
466
+ languageCode?: string;
467
+ login?: string;
468
+ fullName?: string;
469
+ email?: string;
470
+ }
471
+ export type Schema = Schema.Object | Schema.Object[];
472
+ export namespace Schema {
473
+ type Object = {
474
+ $id?: ObjectId;
475
+ Code?: ObjectCode;
476
+ DefaultFieldCode?: any;
477
+ Deleted?: boolean;
478
+ Fields?: Field[];
479
+ ID?: ObjectId;
480
+ ID_ObjectType?: string;
481
+ ID_ver_Module?: ModuleId;
482
+ OBJECT_ID?: number;
483
+ tag_Enabled?: boolean;
484
+ Title?: ObjectTitle;
485
+ "Title@"?: ObjectTitle;
486
+ TitlePlural?: string;
487
+ "TitlePlural@"?: string;
488
+ Description?: string;
489
+ Readonly?: boolean;
490
+ Icon?: string;
491
+ audit_Enabled?: boolean;
492
+ inline_AddInRow?: boolean;
493
+ inline_Enabled?: boolean;
494
+ HierarchyParentField?: string;
495
+ HierarchyIDField?: string;
496
+ FlagHierarchy?: boolean;
497
+ FlagConfiguration?: boolean;
498
+ Settings: string;
499
+ AccessLevel: string;
500
+ Parameters?: Parameter[];
501
+ } & Record<string, any>;
502
+ type Field = {
503
+ Code: string;
504
+ Type: string;
505
+ DataType: string;
506
+ $id?: ObjectId;
507
+ ID?: ObjectId;
508
+ Title?: string;
509
+ "Title@"?: string;
510
+ Identity?: boolean;
511
+ RefTableCode?: string;
512
+ SortOreder?: number;
513
+ FlagScriptDfkInline?: boolean;
514
+ Primary?: boolean;
515
+ Readonly?: boolean;
516
+ };
517
+ type Parameter = {
518
+ Code: string;
519
+ DataType: string;
520
+ };
521
+ }
522
+ export {};
523
+ }
524
+ type AggregationType = "sum" | "avg" | "count" | "max" | "min";
525
+ type Filter = Filter.Simple | Filter.List | Filter.SubQuery | Filter.Multi;
526
+ namespace Filter {
527
+ export type MultiOp = "and" | "or";
528
+ export type BinaryOp = "eq" | "ge" | "le" | "gt" | "lt" | "ne" | "contains" | "startsWith" | "endsWith" | "fullText" | "in";
529
+ export interface Multi extends WithNot {
530
+ op: MultiOp;
531
+ groups: Filter[];
532
+ }
533
+ interface WithNot {
534
+ not?: boolean;
535
+ }
536
+ export interface Simple extends WithNot, WithCastType {
537
+ op: BinaryOp;
538
+ path: string;
539
+ value?: any;
540
+ }
541
+ export interface List extends WithNot, WithCastType {
542
+ op: BinaryOp;
543
+ path: string;
544
+ list: string[];
545
+ }
546
+ export interface SubQuery extends WithNot, WithCastType {
547
+ op: BinaryOp;
548
+ path: string;
549
+ query: SubQueryExpression;
550
+ }
551
+ export interface SubQueryExpression {
552
+ table: string;
553
+ field: string;
554
+ filter?: Filter;
555
+ params?: {
556
+ [k: string]: any;
557
+ };
558
+ }
559
+ interface WithCastType {
560
+ castType?: ApiV2.Request.Fetch.CastType;
561
+ }
562
+ export {};
563
+ }
564
+ }
565
+ /**
566
+ * Расширение позволяет получить информацию о ссылках на текущую запись.
567
+ */
568
+ declare namespace FetchDependencyTypes {
569
+ /**
570
+ * В запросе указывается таблица и поле, которое ссылается на текущую таблицу
571
+ */
572
+ type Request = {
573
+ table: string;
574
+ field: string;
575
+ };
576
+ /**
577
+ * В ответе вместе с записью приходит информация есть ли ссылки на эту запись по указанным в запросе данным
578
+ */
579
+ type RecordExtResponse = {
580
+ hasDependencies: boolean;
581
+ };
582
+ }
583
+ export {};