@apia/execution 4.0.45 → 5.0.0

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/dist/index.d.ts CHANGED
@@ -1,11 +1,36 @@
1
1
  import { AxiosRequestConfig, AxiosResponse } from 'axios';
2
2
  import { IStringifyOptions } from 'qs';
3
3
  import { TableController, Row, Cell, CellState } from '@apia/table2-controller';
4
- import { DeepReadonly, EventEmitter as EventEmitter$1, TApiaLoad, TApiaFunction, TApiaLoadForm, Mutex } from '@apia/util';
4
+ import { DeepReadonly, TApiaLoadForm, EventEmitter as EventEmitter$1, Mutex } from '@apia/util';
5
+ import { UploaderApi as UploaderApi$1, TModalConfig, TUploaderFileInfo, UploaderModalController, TFileUploaded, TSaveDroppedFilesConf } from '@apia/uploader-controller';
5
6
  import { MobXTree } from '@apia/tree2-controller';
6
7
  import * as _apia_scheduler_controller from '@apia/scheduler-controller';
7
8
  import { TScheduleResult, Scheduler } from '@apia/scheduler-controller';
8
9
 
10
+ type NotificationIcon = string;
11
+ type NotificationType = 'info' | 'error' | 'success' | 'warning' | 'modal';
12
+ type NotificationDefinition = {
13
+ icon?: NotificationIcon;
14
+ id?: string | number;
15
+ isOpen?: boolean;
16
+ message: string;
17
+ stackTrace?: string;
18
+ title?: string;
19
+ type?: NotificationType;
20
+ };
21
+ declare abstract class Notification<State extends NotificationDefinition = NotificationDefinition> {
22
+ readonly props: State;
23
+ protected state: State;
24
+ constructor(props: State);
25
+ get icon(): string | undefined;
26
+ get id(): string | number | undefined;
27
+ get isOpen(): boolean | undefined;
28
+ get message(): string;
29
+ get stackTrace(): string | undefined;
30
+ get title(): string | undefined;
31
+ get type(): NotificationType | undefined;
32
+ }
33
+
9
34
  type TApiaButtonDefinition = TApiaFieldBaseDefinition<TApiaButtonProperties> & {
10
35
  fieldType: 'button';
11
36
  };
@@ -1052,7 +1077,7 @@ declare class ApiaForm implements IApiaForm {
1052
1077
  declare abstract class ApiaField<Props extends typeof FieldConstants = typeof FieldConstants> implements IApiaField<Props> {
1053
1078
  #private;
1054
1079
  constructor(execution: Execution, field: Field<any>);
1055
- get fldType(): "button" | "check" | "file" | "hidden" | "image" | "input" | "href" | "multiple" | "radio" | "select" | "label" | "area" | "title" | "editor" | "grid" | "password" | "captcha" | "tree";
1080
+ get fldType(): "title" | "button" | "check" | "file" | "hidden" | "image" | "input" | "href" | "multiple" | "radio" | "select" | "label" | "area" | "editor" | "grid" | "password" | "captcha" | "tree";
1056
1081
  get fldId(): string;
1057
1082
  get form(): ApiaForm;
1058
1083
  get index(): number;
@@ -1888,6 +1913,52 @@ declare class CustomComponent {
1888
1913
  setState<K extends keyof TCustomComponentState>(prop: K, value: TCustomComponentState[K]): void;
1889
1914
  }
1890
1915
 
1916
+ declare enum ExecutionState {
1917
+ RUNNING = 0,
1918
+ LOADING = 1,
1919
+ FINISHED = 2,
1920
+ RENDERING = 3,
1921
+ CONFIRMING = 4,
1922
+ FINISHED_WITH_ERROR = 5
1923
+ }
1924
+ type TOnClose = 'clearEvalPath' | 'confirmOkOnClose' | 'confirmOkOnCloseSplash' | 'confirmOkOnSaveSplash' | 'releaseOkOnClose' | null;
1925
+ type TErrMessage = {
1926
+ message: {
1927
+ text: string;
1928
+ label?: string;
1929
+ };
1930
+ };
1931
+ type TFetchTaskActionResponse = {
1932
+ onClose?: TOnClose;
1933
+ sysMessages?: TErrMessage;
1934
+ sysExceptions?: TErrMessage;
1935
+ type?: string;
1936
+ actions?: {
1937
+ action: {
1938
+ param: string[];
1939
+ toDo: string;
1940
+ };
1941
+ };
1942
+ load?: {
1943
+ canClose: boolean;
1944
+ type: string;
1945
+ text: {
1946
+ label: string;
1947
+ closeAll: boolean;
1948
+ addClass?: string;
1949
+ title?: string;
1950
+ };
1951
+ };
1952
+ text?: {
1953
+ title?: string;
1954
+ label?: string;
1955
+ };
1956
+ };
1957
+ type FieldError = {
1958
+ id: string;
1959
+ errorMessage: string;
1960
+ };
1961
+
1891
1962
  declare class Form extends WithProperties<TApiaFormProperties> {
1892
1963
  execution: Execution;
1893
1964
  fields: TApiaFieldBaseDefinition<Record<string, any>>[];
@@ -1952,6 +2023,7 @@ declare class Form extends WithProperties<TApiaFormProperties> {
1952
2023
  fireScriptEvent(eventName: TFormEventName): Promise<boolean>;
1953
2024
  validate(): Promise<true | Field>;
1954
2025
  getProperty<K extends keyof TApiaFormProperties>(propName: K | 'readOnly'): TApiaFormProperties[K];
2026
+ getErrorsList(): FieldError[];
1955
2027
  }
1956
2028
 
1957
2029
  type TTranslationState = {
@@ -2009,30 +2081,6 @@ declare abstract class TranslatableField<FieldProps extends TApiaTranslatableFie
2009
2081
  type FieldConstructor = new (definition: any) => Field<any, any, any> | FieldWithAttribute<any, any, any> | TranslatableField<any, any, any>;
2010
2082
  type FieldsMapping = Record<string, (definition: any) => FieldConstructor>;
2011
2083
 
2012
- type NotificationIcon = string;
2013
- type NotificationType = 'info' | 'error' | 'success' | 'warning';
2014
- type NotificationDefinition = {
2015
- icon?: NotificationIcon;
2016
- id?: string | number;
2017
- isOpen?: boolean;
2018
- message: string;
2019
- stackTrace?: string;
2020
- title?: string;
2021
- type?: NotificationType;
2022
- };
2023
- declare abstract class Notification<State extends NotificationDefinition = NotificationDefinition> {
2024
- readonly props: State;
2025
- protected state: State;
2026
- constructor(props: State);
2027
- get icon(): string | undefined;
2028
- get id(): string | number | undefined;
2029
- get isOpen(): boolean | undefined;
2030
- get message(): string;
2031
- get stackTrace(): string | undefined;
2032
- get title(): string | undefined;
2033
- get type(): NotificationType | undefined;
2034
- }
2035
-
2036
2084
  declare class Notifications {
2037
2085
  execution: Execution;
2038
2086
  private emitter;
@@ -2144,482 +2192,57 @@ type TProcess = {
2144
2192
  };
2145
2193
  };
2146
2194
 
2147
- /**
2148
- * El comportamiento de esta función se explica por su
2149
- * nombre.
2150
- */
2151
- declare function returnExactlyTheSame(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2152
- declare function isOneClickUploadEnabled(execution: Execution, oneClickUploadProp?: boolean): string | boolean;
2153
- declare const parseFileDefinition: (execution: Execution, fileDefinition: TFileUploaded | TUploaderFileInfo, isSignRequired: boolean) => TUploaderFileInfo;
2154
- type TOnUploadProgress = (progress: number) => void;
2155
- declare class UploaderApi extends EventEmitter$1<{
2156
- fileUploaded: null;
2157
- }> {
2195
+ declare class UploaderApi extends UploaderApi$1 {
2158
2196
  execution: Execution;
2159
- id: string;
2160
2197
  type: 'E' | 'P';
2161
- modalConfig: TModalConfig;
2162
- maxFiles: number;
2163
- modalController: UploaderModalController | null;
2164
- allowTranslations: boolean;
2165
- langs: Record<number, string> | undefined;
2166
- currentConfiguration: TUploaderLoadCurrentFunctionMessages | undefined;
2167
- docTypePermittedObjId: string | undefined;
2168
- state: UploaderState;
2169
- get filesArray(): TUploaderFileInfo[];
2198
+ docTypePermittedObjId: string;
2170
2199
  constructor(execution: Execution, id: string, type: 'E' | 'P', modalConfig: TModalConfig);
2171
- init(): Promise<void>;
2172
- onStartUpload(files?: File[]): Promise<void>;
2173
- onTranslateUpload(conf: {
2174
- langId: number;
2175
- translatingFile: TUploaderFileInfo;
2176
- }, files?: File[]): Promise<void>;
2177
- onVersionUpload(file: TUploaderFileInfo, conf?: {
2178
- newFiles?: File[];
2179
- langId?: number;
2180
- translatingFile?: TUploaderFileInfo;
2181
- }): Promise<void>;
2182
- autoLock(): Promise<boolean>;
2183
- notify(notification: NotificationDefinition): void;
2184
- protected getAjaxUrl(): string;
2185
- getDocTypes(): TDocType[];
2186
- getCurrentDocTypeId(): string;
2187
- getCurrentDocType(): TDocType | undefined;
2188
- getInProgressFiles(): File[];
2189
- getHiddenFiles(): File[];
2190
- getExistingFiles(): Record<string, TUploaderFileInfo>;
2191
- getProgress(): number;
2192
- getHasAllDocTypes(): boolean | undefined;
2193
- getDocumentInfo({ docId: apiId, downloadDocId: docId, }: TRequireOnlyOne<{
2194
- docId: string;
2195
- downloadDocId: string;
2196
- }>, newElem?: boolean): Promise<({
2197
- canClose: boolean;
2198
- type: string;
2199
- } & {
2200
- function: {
2201
- name: string;
2202
- } & {
2203
- data: {
2204
- onClose: string;
2205
- general: TApiaDocumentDefinition;
2206
- permissions: {
2207
- pool: TDocumentPermission | TDocumentPermission[];
2208
- user: TDocumentPermission | TDocumentPermission[];
2209
- };
2210
- versions: {
2211
- version: TDocumentVersion | TDocumentVersion[];
2212
- };
2213
- };
2214
- currentUsrPems: {
2215
- usrCanModify: boolean;
2216
- };
2217
- metadatas: {
2218
- metadata: TDocumentMetadata | TDocumentMetadata[];
2219
- };
2220
- docDownHistory: {
2221
- docHistory: TDocumentDownloadHistory | TDocumentDownloadHistory[];
2222
- };
2223
- };
2224
- } & ResponseSysMessages) | null>;
2225
- /**
2226
- * This method searches for the provided id in several places:
2227
- *
2228
- * If it's found in the current files, returns it.
2229
- * If not, it searches the provided docId in the translations map of each uploaded file.
2230
- */
2231
- getDocument(docId: string): TUploaderFileInfo | undefined;
2232
- protected updateDocument(docId: string, newValue: TUploaderFileInfo): void;
2233
- protected deleteDocument(docId: string): void;
2234
- clearFile(name: string): void;
2235
- clearFiles(): void;
2236
- clearState(): void;
2237
- checkLockDocument(id: string, shouldNotifyUnlocked?: boolean): Promise<string | boolean>;
2238
- setCurrentDocTypeId(docTypeId: string): void;
2239
- ajaxUploadStart(newFiles?: File[]): Promise<boolean | undefined>;
2240
- reloadMetadata(props?: Partial<{
2241
- docId: string;
2242
- docTypeId: number | string;
2243
- }>, additionalProps?: Record<string, unknown>): Promise<void>;
2244
- saveDroppedFiles(unprocessedFiles: File[], conf?: TSaveDroppedFilesConf): Promise<boolean>;
2245
- checkWebDavLock(docId: string): Promise<unknown>;
2246
- checkSignature(file: TUploaderFileInfo): Promise<TApiaApiAxiosResponse<({
2247
- markedToSign: boolean;
2248
- } & ResponseSysMessages) | null> | null>;
2249
- editDocument(id: string): Promise<void>;
2250
- downloadVersion(fileId: string, version?: string): Promise<void>;
2251
- downloadDocument(id: string, version?: string): Promise<void>;
2252
- ajaxDeleteDocument(id: string, langId?: number): Promise<void>;
2253
- version(file: TUploaderFileInfo, conf?: {
2254
- newFiles?: File[];
2255
- langId?: number;
2256
- translatingFile?: TUploaderFileInfo;
2257
- }): Promise<void>;
2258
- versionFileInfo(file: TUploaderFileInfo): Promise<void>;
2259
- pickFileById(id: string): Promise<void>;
2260
- markFileToSign(id: string, langId?: string): Promise<void>;
2261
- /**
2262
- * Por el momento realiza la descarga de todos los archivos
2263
- * que estén subidos.
2264
- */
2265
- downloadMultipleDocuments(): void;
2266
- confirmDropModal(conf?: {
2267
- langId?: number;
2268
- translatingFile?: TUploaderFileInfo;
2269
- }): Promise<boolean>;
2270
- loadCurrentDocuments(): Promise<void>;
2271
- lockDocument(id: string): Promise<void>;
2272
- protected evaluateDeleteDocumentResult(result: unknown): boolean;
2273
- setTranslationFile(file: TUploaderFileInfo, docId: string, langId: number): void;
2274
- protected getCheckSignatureParameters: typeof returnExactlyTheSame;
2275
- protected getAjaxUploadFileStatusParameters: typeof returnExactlyTheSame;
2276
- protected getAjaxUploadStartParameters: typeof returnExactlyTheSame;
2277
- protected getConfirmDropModalParameters: typeof returnExactlyTheSame;
2278
- protected getCheckLockDocumentParameters: typeof returnExactlyTheSame;
2279
- protected getCheckWebDavLockParameters: typeof returnExactlyTheSame;
2280
- protected getConfirmDropModalPostdata: typeof returnExactlyTheSame;
2281
- protected getConfirmDropModalMetadataString: ({ metadata, }: {
2282
- metadata: TDocumentMetadata[];
2283
- }) => string;
2284
- protected getConfirmDropModalPermissionsString: ({ poolsPermissions, usersPermissions, }: {
2285
- poolsPermissions: IPoolsPermissions[];
2286
- usersPermissions: IUsersPermissions[];
2287
- }) => string;
2288
- protected getConfirmDropModalAdditionalMetadataString: (additionalMetadata: TDocumentMetadata[] | []) => string;
2289
- protected getDeleteDocumentParameters: typeof returnExactlyTheSame;
2290
- protected getClearTempFilesParameters: typeof returnExactlyTheSame;
2291
- protected getDocumentInfoParameters: typeof returnExactlyTheSame;
2292
- protected getDownloadMultipleDocumentsParameters: typeof returnExactlyTheSame;
2293
- protected getEditDocumentParameters: typeof returnExactlyTheSame;
2294
- protected getLockDocumentParameters: typeof returnExactlyTheSame;
2295
- protected getMarkFileToSignParameters: typeof returnExactlyTheSame;
2296
- protected getProcessDroppedFilesParameters: typeof returnExactlyTheSame;
2297
- protected getProcessDroppedFilesPostdata: typeof returnExactlyTheSame;
2298
- protected getReloadMetadataParameters: typeof returnExactlyTheSame;
2299
- protected getSaveDroppedFilesParameters: typeof returnExactlyTheSame;
2300
- protected filterAlreadyUploadedFiles(files: File[], conf?: TSaveDroppedFilesConf): File[];
2301
- protected filterByFilesAmountLimit(files: File[]): File[];
2302
- protected filterAcceptedFiles(files: File[], shouldNotify?: boolean, docTypeId?: string | TDocType): File[];
2303
- protected filterExistingFiles(files: File[], conf?: TSaveDroppedFilesConf): File[];
2304
- protected filterVersioningFiles(files: File[], conf?: {
2305
- langId?: number;
2306
- strictMode?: boolean;
2307
- translatingFile?: TUploaderFileInfo;
2308
- shouldReset?: boolean;
2309
- }): File[];
2310
- parseFileDefinition: (file: TFileUploaded) => TUploaderFileInfo;
2311
2200
  getLoadFileSystemStructureTree(): Record<string, unknown>;
2312
2201
  getLoadFilesForFolderParameters(): Record<string, unknown>;
2313
- }
2314
-
2315
- declare class UploaderModalController {
2316
- api: UploaderApi;
2317
- modalConfig: TModalConfig;
2318
- conf?: {
2319
- langId?: number;
2320
- translatingFile?: TUploaderFileInfo;
2321
- versionFile?: TUploaderFileInfo;
2322
- } | undefined;
2323
- state: UploaderModalState;
2324
- constructor(api: UploaderApi, modalConfig: TModalConfig, conf?: {
2325
- langId?: number;
2326
- translatingFile?: TUploaderFileInfo;
2327
- versionFile?: TUploaderFileInfo;
2328
- } | undefined);
2329
- get allMetadata(): TDocumentMetadata[];
2330
- get allowAllType(): "" | "M" | "R";
2331
- get description(): string;
2332
- get docFolder(): number | undefined;
2333
- get docExpDate(): string | undefined;
2334
- get docTypes(): TDocType[];
2335
- get freeMetadata(): TDocumentMetadata[];
2336
- get exitingFiles(): Record<string, TUploaderFileInfo>;
2337
- get inProgressFiles(): File[];
2338
- get hiddenFiles(): File[];
2339
- get progress(): number;
2340
- get metadata(): TDocumentMetadata[];
2341
- get selectedDocTypeId(): string;
2342
- get selectedDocType(): TDocType | undefined;
2343
- addMetadata(): void;
2344
- addFiles(files: File[]): void;
2345
- addDirectoryFile(file: TApiaDocumentDefinition): void;
2346
- changeDocType(docTypeId: string): Promise<void>;
2347
- clearDirectoryFile(): void;
2348
- clearFile(name: string): void;
2349
- clearFiles(): void;
2350
- clearState(): void;
2351
- clearPartialState(): void;
2352
- onCloseModal(): void;
2353
- confirm(): Promise<boolean>;
2354
- deleteMetadata(indices: number[]): void;
2355
- deletePermission(item: IPoolsPermissions | IUsersPermissions): void;
2356
- protected onChangeExtension(): void;
2357
- openModal(): Promise<void>;
2358
- setDescription(desc: string): void;
2359
- protected resetMetadata(): Promise<void>;
2360
- validate(): boolean;
2361
- }
2362
-
2363
- type TUploadModalOpener = (controller: UploaderModalController) => void;
2364
- type UploaderModalState = {
2365
- fileReqError: boolean;
2366
- metadata: {
2367
- metadataArray: TDocumentMetadata[];
2368
- isFreeMetadata: boolean;
2369
- freeMetadataArray: TDocumentMetadata[];
2370
- };
2371
- fromDirectoryFile: TApiaDocumentDefinition | null;
2372
- docFolder?: number;
2373
- docPath?: string;
2374
- docExpDate?: string;
2375
- description: string;
2376
- isReadonly?: boolean;
2377
- permissions: {
2378
- allowAllType: 'M' | 'R' | '';
2379
- users: IUsersPermissions[];
2380
- pools: IPoolsPermissions[];
2381
- };
2382
- };
2383
- type UploaderState = {
2384
- progress: number;
2385
- allowedTypes: TDocType[];
2386
- selectedDocTypeId: string;
2387
- versioningFile: TUploaderFileInfo | null;
2388
- inProgressFiles: File[];
2389
- hiddenFiles: File[];
2390
- files: Record<string, TUploaderFileInfo>;
2391
- translatedFiles: Map<string, Map<number, TUploaderFileInfo>>;
2392
- hasAllDocTypes?: boolean;
2393
- selectedFiles: string[];
2394
- };
2395
- interface IUsersPermissions {
2396
- userId: string;
2397
- userLogin: string;
2398
- canUpdate: boolean;
2399
- }
2400
- interface IPoolsPermissions {
2401
- poolId: string;
2402
- poolName: string;
2403
- canUpdate: boolean;
2404
- }
2405
- type TUploaderFileInfo = Omit<TFileUploaded, 'locked' | 'userLocking'> & {
2406
- canEdit?: boolean;
2407
- canRead?: boolean;
2408
- isLocked: boolean;
2409
- locked?: boolean;
2410
- isLockedByMe: boolean;
2411
- isVirtual: boolean;
2412
- lockingUser: string;
2413
- };
2414
- type TFileUploaded = {
2415
- canEdit?: boolean;
2416
- canWrite?: boolean;
2417
- canRead?: boolean;
2418
- description?: string;
2419
- docDescription?: string;
2420
- docId: string;
2421
- docLang?: string;
2422
- docLangGroup?: string;
2423
- docName?: string;
2424
- docSize?: string;
2425
- docTypeFreeMetadata?: boolean;
2426
- docTypeId?: string;
2427
- docTypeLabel?: string;
2428
- docTypeTitle: string;
2429
- downloadDocId: string;
2430
- isMarkedToSign: boolean;
2431
- markedToSign: boolean;
2432
- lock?: string | boolean;
2433
- isLocked?: string | boolean;
2434
- lockedBy?: string;
2435
- name?: string;
2436
- onlyInformation: boolean;
2437
- prefix: string;
2438
- preview: string;
2439
- sign?: string | boolean;
2440
- size?: string;
2441
- userLocking: string;
2442
- virtualDoc?: boolean;
2443
- locked?: boolean;
2444
- };
2445
- type TAjaxUploadStart = TApiaLoad<TApiaFunction<{
2446
- general: {
2447
- isDocTypeDisabled: boolean;
2202
+ protected getAjaxUploadStartParameters(defaultParameters: Record<string, unknown>): {
2203
+ prefix: "P" | "E";
2448
2204
  useDocTypePermitted: boolean;
2449
- createMode: boolean;
2450
- allowAllTypes: string;
2451
- allDocTypes: boolean;
2205
+ docTypePermittedObjType: "P" | "E";
2206
+ docTypePermittedObjId: string;
2452
2207
  };
2453
- docTypes: {
2454
- docType: TDocType | TDocType[];
2208
+ protected addPrefix(defaultParameters: Record<string, unknown>): {
2209
+ prefix: "P" | "E";
2455
2210
  };
2456
- metadatas: {
2457
- metadata: TDocumentMetadata | TDocumentMetadata[];
2211
+ protected getDocumentInfoParameters(defaultParameters: Record<string, unknown>): {
2212
+ prefix: "P" | "E";
2458
2213
  };
2459
- }, false>>;
2460
- type TDocType = {
2461
- docExts: string;
2462
- maxSize: number;
2463
- id: string;
2464
- title: string;
2465
- free: boolean;
2466
- selected: boolean;
2467
- };
2468
- type TDocumentMetadata = {
2469
- free: string;
2470
- id: string;
2471
- name: string;
2472
- required: 'Y' | 'N';
2473
- title: string;
2474
- type: 'S' | 'N' | 'D';
2475
- value: string;
2476
- errorMessage: string;
2477
- labelErrorMessage: string;
2478
- };
2479
- type TModalConfig = {
2480
- allowDocumentsMonitor: boolean;
2481
- allowPickFromDirectories: boolean;
2482
- collapsePermissions: boolean;
2483
- collapseDirectories: boolean;
2484
- collapseMetadata: boolean;
2485
- defaultDirectory?: number;
2486
- monitorId?: number;
2487
- oneClickUpload: boolean;
2488
- rootFolder?: string;
2489
- showDirectoriesStructure: boolean;
2490
- showExpDate: boolean;
2491
- showPermissions: boolean;
2492
- showMetadata: boolean;
2493
- translationId?: string;
2494
- };
2495
- type TUploaderLoadCurrentFunctionMessages = {
2496
- allowSign: boolean;
2497
- allowLock: boolean;
2498
- allowMultiple: boolean;
2499
- readOnly: boolean;
2500
- };
2501
- type TSaveDroppedFilesConf = {
2502
- langId?: number;
2503
- strictMode?: boolean;
2504
- translatingFile?: TUploaderFileInfo;
2505
- shouldReset?: boolean;
2506
- };
2507
- type TAjaxUploadFileStatus = TApiaLoad<TApiaFunction<{
2508
- message: {
2509
- label: string;
2510
- name: string;
2511
- }[];
2512
- }>>;
2513
- type TProcessDroppedFiles = TApiaLoad<TApiaFunction<{
2514
- principal: {
2515
- docInfo: TDocInfo | TDocInfo[];
2516
- docTypes: {
2517
- 'data-free': boolean;
2518
- docTypeExtensions: string;
2519
- docTypeId: string;
2520
- docTypeMaxSize: number;
2521
- docTypeName: string;
2522
- };
2523
- elemInfo: {
2524
- elemId: string;
2525
- elemType: string;
2526
- };
2214
+ protected getCheckLockDocumentParameters: (defaultParameters: Record<string, unknown>) => {
2215
+ prefix: "P" | "E";
2527
2216
  };
2528
- }, false>>;
2529
- type TDocInfo = {
2530
- docInfoName: string;
2531
- docInfoSize: string;
2532
- docInfoTmpId: string;
2533
- docInfoType: string;
2534
- };
2535
- type TConfirmDropModal = TApiaLoad<TApiaFunction<{
2536
- general: TFileUploaded | TFileUploaded[];
2537
- fromForm: {
2538
- fromForm: {
2539
- fromForm: boolean;
2540
- }[];
2541
- };
2542
- }, false>>;
2543
- type TApiaDocumentDefinition = {
2544
- docDesc: string;
2545
- docTypeLabel: string;
2546
- docId: string;
2547
- prefix: string;
2548
- docSize: string;
2549
- docDate: string;
2550
- docDwnExternal: string;
2551
- docExpDate: string;
2552
- docFolder: string;
2553
- docFolderPath: string;
2554
- docUsu: string;
2555
- docAllPoolPerm: 'M' | 'R' | '';
2556
- docName: string;
2557
- docTypeId: string;
2558
- locked: boolean;
2559
- downloadDocId: string;
2560
- };
2561
- type TUploaderLoadCurrentFunction = {
2562
- general?: TFileUploaded | TFileUploaded[];
2563
- messages: {
2564
- message: {
2565
- name: keyof TUploaderLoadCurrentFunctionMessages;
2566
- label: boolean;
2567
- } | {
2568
- name: keyof TUploaderLoadCurrentFunctionMessages;
2569
- label: boolean;
2570
- }[];
2217
+ protected getReloadMetadataParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2218
+ protected getSaveDroppedFilesParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2219
+ protected getAjaxUploadFileStatusParameters(defaultParameters: Record<string, unknown>): {
2220
+ prefix: "P" | "E";
2571
2221
  };
2572
- };
2573
- type TDocumentInformation = TApiaLoad<TApiaFunction<{
2574
- data: {
2575
- onClose: string;
2576
- general: TApiaDocumentDefinition;
2577
- permissions: {
2578
- pool: TDocumentPermission | TDocumentPermission[];
2579
- user: TDocumentPermission | TDocumentPermission[];
2580
- };
2581
- versions: {
2582
- version: TDocumentVersion | TDocumentVersion[];
2583
- };
2584
- };
2585
- currentUsrPems: {
2586
- usrCanModify: boolean;
2587
- };
2588
- metadatas: {
2589
- metadata: TDocumentMetadata | TDocumentMetadata[];
2590
- };
2591
- docDownHistory: {
2592
- docHistory: TDocumentDownloadHistory | TDocumentDownloadHistory[];
2593
- };
2594
- }, false>>;
2595
- type TDocumentPermission = {
2596
- id: string;
2597
- name: string;
2598
- permType: 'R' | 'M';
2599
- };
2600
- type TDocumentDownloadHistory = {
2601
- hisDwn: string;
2602
- hisUsr: string;
2603
- hisVer: string;
2604
- };
2605
- type TDocumentVersion = {
2606
- verUser: string;
2607
- verNumber: string;
2608
- verDate: string;
2609
- };
2610
- type TRequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
2611
- [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
2612
- }[Keys];
2222
+ protected getMarkFileToSignParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2223
+ protected getProcessDroppedFilesPostdata(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2224
+ protected getProcessDroppedFilesParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2225
+ protected getConfirmDropModalParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2226
+ protected getConfirmDropModalPostdata(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2227
+ protected getCheckWebDavLockParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2228
+ protected getDownloadMultipleDocumentsParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2229
+ protected getLoadCurrentDocumentsParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2230
+ protected getDeleteDocumentParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2231
+ }
2613
2232
 
2614
2233
  declare class FormsUploader extends UploaderApi {
2615
2234
  execution: Execution;
2616
2235
  type: 'E' | 'P';
2617
- modalConfig: TModalConfig;
2618
2236
  field: File$1;
2619
2237
  constructor(execution: Execution, type: 'E' | 'P', modalConfig: TModalConfig, field: File$1);
2620
2238
  isEditionMode: boolean | undefined;
2621
2239
  index(): number;
2622
2240
  elemId(): string;
2241
+ protected buildModalController(conf?: {
2242
+ langId?: number;
2243
+ translatingFile?: TUploaderFileInfo;
2244
+ versionFile?: TUploaderFileInfo;
2245
+ }): UploaderModalController;
2623
2246
  protected filterByFilesAmountLimit(files: File[]): File[];
2624
2247
  protected getFormParameters(): {
2625
2248
  frmId: string;
@@ -2651,8 +2274,27 @@ declare class FormsUploader extends UploaderApi {
2651
2274
  frmOut: boolean;
2652
2275
  };
2653
2276
  };
2654
- getAjaxUploadFileStatusParameters: (defaultParameters: Record<string, unknown>) => Record<string, unknown>;
2655
- getAjaxUploadStartParameters: ({ useDocTypePermitted, docTypePermittedObjType, docTypePermittedObjId, ...defaultParameters }: Record<string, unknown>) => Record<string, unknown>;
2277
+ getAjaxUploadFileStatusParameters(defaultParameters: Record<string, unknown>): {
2278
+ frmId: string;
2279
+ frmParent: TFrmParent;
2280
+ attId: string;
2281
+ index: number;
2282
+ editionMode: boolean | undefined;
2283
+ prefix: TFrmParent;
2284
+ forceDocTypeId: string | undefined;
2285
+ };
2286
+ getAjaxUploadStartParameters({ useDocTypePermitted, docTypePermittedObjType, docTypePermittedObjId, ...defaultParameters }: Record<string, unknown>): {
2287
+ frmId: string;
2288
+ frmParent: TFrmParent;
2289
+ attId: string;
2290
+ index: number;
2291
+ editionMode: boolean | undefined;
2292
+ prefix: TFrmParent;
2293
+ forceDocTypeId: string | undefined;
2294
+ useDocTypePermitted: boolean;
2295
+ docTypePermittedObjType: "P" | "E";
2296
+ docTypePermittedObjId: string;
2297
+ };
2656
2298
  getCheckLockDocumentParameters: ({ prefix, ...parameters }: Record<string, unknown>) => {
2657
2299
  frmId: string;
2658
2300
  frmParent: TFrmParent;
@@ -2671,7 +2313,7 @@ declare class FormsUploader extends UploaderApi {
2671
2313
  attId: string;
2672
2314
  index: number;
2673
2315
  };
2674
- getConfirmDropModalParameters: (defaultParameters: Record<string, unknown>) => Record<string, unknown>;
2316
+ getConfirmDropModalParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2675
2317
  getConfirmDropModalPostdata: ({ pe, ...parameters }: Record<string, unknown>) => Record<string, unknown>;
2676
2318
  getDeleteDocumentParameters: ({ prefix, isAjax, ...currentParameters }: Record<string, unknown>) => {
2677
2319
  frmId: string;
@@ -2680,8 +2322,9 @@ declare class FormsUploader extends UploaderApi {
2680
2322
  index: number;
2681
2323
  editionMode: boolean | undefined;
2682
2324
  };
2683
- getDocumentInfoParameters: (parameters: Record<string, unknown>) => {
2325
+ getDocumentInfoParameters(parameters: Record<string, unknown>): {
2684
2326
  ajaxUrl: string;
2327
+ prefix: "P" | "E";
2685
2328
  };
2686
2329
  getEditDocumentParameters: ({ action, docId }: Record<string, unknown>) => {
2687
2330
  docId: unknown;
@@ -2695,7 +2338,7 @@ declare class FormsUploader extends UploaderApi {
2695
2338
  getLoadFilesForFolderParameters: () => Record<string, unknown>;
2696
2339
  getLoadFileSystemStructureTree: () => {
2697
2340
  useDocTypePermitted: boolean;
2698
- docTypeForcedId: string | undefined;
2341
+ docTypeForcedId: string;
2699
2342
  };
2700
2343
  getLockDocumentParameters: ({ prefix, isAjax, ...currentParameters }: Record<string, unknown>) => {
2701
2344
  frmId: string;
@@ -2716,8 +2359,8 @@ declare class FormsUploader extends UploaderApi {
2716
2359
  };
2717
2360
  getProcessDroppedFilesParameters: (defaultParameters: Record<string, unknown>) => Record<string, unknown>;
2718
2361
  getProcessDroppedFilesPostdata: ({ useDocTypePermitted, docTypePermittedObjId, docTypePermittedObjType, ...parameters }: Record<string, unknown>) => Record<string, unknown>;
2719
- getReloadMetadataParameters: (defaultParameters: Record<string, unknown>) => Record<string, unknown>;
2720
- getSaveDroppedFilesParameters: (defaultParameters: Record<string, unknown>) => Record<string, unknown>;
2362
+ getReloadMetadataParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2363
+ getSaveDroppedFilesParameters(defaultParameters: Record<string, unknown>): Record<string, unknown>;
2721
2364
  downloadVersion(fileId: string, version?: string): Promise<void>;
2722
2365
  downloadDocument(fileId: string, version?: string): Promise<void>;
2723
2366
  loadCurrentDocuments(): Promise<void>;
@@ -2910,48 +2553,6 @@ declare abstract class FlowModal<T extends {
2910
2553
  abstract confirm(result: T): Promise<Status | FlowModal<any>>;
2911
2554
  }
2912
2555
 
2913
- declare enum ExecutionState {
2914
- RUNNING = 0,
2915
- LOADING = 1,
2916
- FINISHED = 2,
2917
- RENDERING = 3,
2918
- CONFIRMING = 4,
2919
- FINISHED_WITH_ERROR = 5
2920
- }
2921
- type TOnClose = 'clearEvalPath' | 'confirmOkOnClose' | 'confirmOkOnCloseSplash' | 'confirmOkOnSaveSplash' | 'releaseOkOnClose' | null;
2922
- type TErrMessage = {
2923
- message: {
2924
- text: string;
2925
- label?: string;
2926
- };
2927
- };
2928
- type TFetchTaskActionResponse = {
2929
- onClose?: TOnClose;
2930
- sysMessages?: TErrMessage;
2931
- sysExceptions?: TErrMessage;
2932
- type?: string;
2933
- actions?: {
2934
- action: {
2935
- param: string[];
2936
- toDo: string;
2937
- };
2938
- };
2939
- load?: {
2940
- canClose: boolean;
2941
- type: string;
2942
- text: {
2943
- label: string;
2944
- closeAll: boolean;
2945
- addClass?: string;
2946
- title?: string;
2947
- };
2948
- };
2949
- text?: {
2950
- title?: string;
2951
- label?: string;
2952
- };
2953
- };
2954
-
2955
2556
  type TCheckWizardResponse = {
2956
2557
  url: string;
2957
2558
  };
@@ -3090,6 +2691,7 @@ type TExecutionEnvironment = {
3090
2691
  taskName: string;
3091
2692
  processName: string;
3092
2693
  };
2694
+ openUploaderModal?: (execution: UploaderModalController) => unknown;
3093
2695
  };
3094
2696
  declare class Execution extends EventEmitter$1<{
3095
2697
  flow: 'previous' | 'confirm' | 'next' | 'save' | 'release' | 'share' | 'viewDocs' | 'print' | 'delegate';
@@ -3101,6 +2703,7 @@ declare class Execution extends EventEmitter$1<{
3101
2703
  };
3102
2704
  }> {
3103
2705
  environment: TExecutionEnvironment;
2706
+ renderers?: TModalConfig['renderers'];
3104
2707
  fieldsMapping: FieldsMapping;
3105
2708
  private entity;
3106
2709
  private process;
@@ -3113,7 +2716,7 @@ declare class Execution extends EventEmitter$1<{
3113
2716
  readonly notifications: Notifications;
3114
2717
  private lastModalReturn;
3115
2718
  private _pendingPromises;
3116
- constructor(environment: TExecutionEnvironment);
2719
+ constructor(environment: TExecutionEnvironment, renderers?: TModalConfig['renderers']);
3117
2720
  protected formsById: {
3118
2721
  E: Map<string, Form>;
3119
2722
  P: Map<string, Form>;
@@ -3128,6 +2731,7 @@ declare class Execution extends EventEmitter$1<{
3128
2731
  hasChangedAnything: boolean;
3129
2732
  };
3130
2733
  addPendingPromise(promise: Promise<boolean>): void;
2734
+ getErrorsList(): FieldError[];
3131
2735
  getAllForms(): Form[];
3132
2736
  private hasInitializedFormsTabs;
3133
2737
  initializeFormsTabs(frmParent: TFrmParent, cb: () => unknown): void;
@@ -4081,5 +3685,5 @@ declare function getLabel(execution: Execution, label: string, replacers?: Parti
4081
3685
 
4082
3686
  declare function parseFakeJSON<T extends Record<string, unknown>>(str: string): T;
4083
3687
 
4084
- export { ActionsController, AdditionalCell, ApiaAttribute, ApiaField, ApiaFieldWithAttribute, ApiaForm, ApiaFunctions, BouncingEmitter, Button, ButtonField, Captcha, CaptchaField, CheckField, Checkbox, type ComponentEvent, CustomComponent, GridField as DataGridField, Editor, EditorField, EventEmitter, Execution, ExecutionState, Field, FieldWithAttribute, type FieldWithAttributeState, type FieldsMapping, File$1 as File, FileUploaderField, FlowModal, Form, FormsUploader, Grid, GridCell, GridField, GridPaginated, HeaderCell, Hidden, HiddenField, type IApiaField, type IApiaForm, type IApiaFunctions, type IIProperty, type IPoolsPermissions, IProperty, type ISignatureData, type IUsersPermissions, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notifications, Password, PasswordField, type PossibleValue, Radio, RadioField, type RadioPossibleValue, SchedulerField, Select, SelectField, type SelectPossibleValue, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign, ShowSignSelection, StatefulEmitter, type Status, StatusNotification, type TAjaxUploadFileStatus, type TAjaxUploadStart, type TApiaButtonProperties, type TApiaCaptchaProperties, type TApiaCheckboxProperties, type TApiaDocumentDefinition, type TApiaEditorProperties, type TApiaFieldBaseDefinition, type TApiaFieldCommonProperties, type TApiaFieldDefinition, type TApiaFieldPossibleValue, type TApiaFieldSizableFieldProperties, type TApiaFieldType, type TApiaFieldValueType, type TApiaFieldWithAttributeBaseProps, type TApiaFieldWithAttributeProperties, type TApiaFileProperties, type TApiaForm, type TApiaFormProperties, type TApiaGridProperties, type TApiaGroupableFieldProperties, type TApiaHiddenProperties, type TApiaImageProperties, type TApiaInputProperties, type TApiaLabelProperties, type TApiaLinkProperties, type TApiaMultipleProperties, type TApiaPasswordProperties, type TApiaRadioProperties, type TApiaSchedulerProperties, type TApiaSelectProperties, type TApiaTextareaProperties, type TApiaTitleProperties, type TApiaTranslatableFieldProperties, type TApiaTreePossibleValue, type TApiaTreeProperties, type TApiaValuatedFieldProperties, type TCheckWizardResponse, type TConfirmDropModal, type TCusCmpStateRequest, type TCustomComponentDefaultResponse, type TCustomComponentDefinition, type TDocInfo, type TDocType, type TDocumentDownloadHistory, type TDocumentInformation, type TDocumentMetadata, type TDocumentPermission, type TDocumentVersion, type TExecutionConfig, type TFetchConfirmPathResponse, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEventParameters, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFileUploaded, type TFormEventName, type TFormScriptEvent, type TFormScriptEventParameters, type TFormScriptEvents, type TFrmParent, type TItemTreeObj, type TModalConfig, type TObservation, type TObservations, type TOnUploadProgress, type TPathType, type TProcessDroppedFiles, type TRequireOnlyOne, type TSaveDroppedFilesConf, type TSignaturesData, type TUploadModalOpener, type TUploaderFileInfo, type TUploaderLoadCurrentFunction, type TUploaderLoadCurrentFunctionMessages, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, UploaderModalController, type UploaderModalState, type UploaderState, createNewField, deepEqual, get, getLabel, isHtmlResponse, isJsonResponse, isOneClickUploadEnabled, isXmlResponse, makeApiaUrl, parseFakeJSON, parseFileDefinition, parseSuccessfulResponse, parseXml, post, returnExactlyTheSame, shallowEqual };
3688
+ export { ActionsController, AdditionalCell, ApiaAttribute, ApiaField, ApiaFieldWithAttribute, ApiaForm, ApiaFunctions, BouncingEmitter, Button, ButtonField, Captcha, CaptchaField, CheckField, Checkbox, type ComponentEvent, CustomComponent, GridField as DataGridField, Editor, EditorField, EventEmitter, Execution, ExecutionState, Field, FieldWithAttribute, type FieldWithAttributeState, type FieldsMapping, File$1 as File, FileUploaderField, FlowModal, Form, FormsUploader, Grid, GridCell, GridField, GridPaginated, HeaderCell, Hidden, HiddenField, type IApiaField, type IApiaForm, type IApiaFunctions, type IIProperty, IProperty, type ISignatureData, Image, ImageField, Input, InputField, InvalidSessionException, Label, Link, LinkField, MessageNotification, ModalInput, ModalInputField, Multiple, MultipleField, Notification, Notifications, Password, PasswordField, type PossibleValue, Radio, RadioField, type RadioPossibleValue, SchedulerField, Select, SelectField, type SelectPossibleValue, ShowConfirmMessage, ShowPathSelection, ShowPoolSelection, ShowSign, ShowSignSelection, StatefulEmitter, type Status, StatusNotification, type TApiaButtonProperties, type TApiaCaptchaProperties, type TApiaCheckboxProperties, type TApiaEditorProperties, type TApiaFieldBaseDefinition, type TApiaFieldCommonProperties, type TApiaFieldDefinition, type TApiaFieldPossibleValue, type TApiaFieldSizableFieldProperties, type TApiaFieldType, type TApiaFieldValueType, type TApiaFieldWithAttributeBaseProps, type TApiaFieldWithAttributeProperties, type TApiaFileProperties, type TApiaForm, type TApiaFormProperties, type TApiaGridProperties, type TApiaGroupableFieldProperties, type TApiaHiddenProperties, type TApiaImageProperties, type TApiaInputProperties, type TApiaLabelProperties, type TApiaLinkProperties, type TApiaMultipleProperties, type TApiaPasswordProperties, type TApiaRadioProperties, type TApiaSchedulerProperties, type TApiaSelectProperties, type TApiaTextareaProperties, type TApiaTitleProperties, type TApiaTranslatableFieldProperties, type TApiaTreePossibleValue, type TApiaTreeProperties, type TApiaValuatedFieldProperties, type TCheckWizardResponse, type TCusCmpStateRequest, type TCustomComponentDefaultResponse, type TCustomComponentDefinition, type TExecutionConfig, type TFetchConfirmPathResponse, type TFieldEvent, type TFieldScriptEvent, type TFieldScriptEventParameters, type TFieldScriptEvents, type TFieldServerEvent, type TFieldServerEvents, type TFormEventName, type TFormScriptEvent, type TFormScriptEventParameters, type TFormScriptEvents, type TFrmParent, type TItemTreeObj, type TObservation, type TObservations, type TPathType, type TSignaturesData, AreaField as TextAreaField, TextField, Textarea, Title, TranslatableField, Translation, Tree, TreeField, UploaderApi, createNewField, deepEqual, get, getLabel, isHtmlResponse, isJsonResponse, isXmlResponse, makeApiaUrl, parseFakeJSON, parseSuccessfulResponse, parseXml, post, shallowEqual };
4085
3689
  //# sourceMappingURL=index.d.ts.map